| | | 1 | | using System.ComponentModel.DataAnnotations; |
| | | 2 | | using System.ComponentModel.DataAnnotations.Schema; |
| | | 3 | | |
| | | 4 | | namespace OzonDomains.Models.BitrixModels; |
| | | 5 | | |
| | | 6 | | [Table("b_catalog_group")] |
| | | 7 | | public class BCatalogGroup |
| | | 8 | | { |
| | | 9 | | [Key] |
| | | 10 | | [Column("ID")] |
| | 0 | 11 | | public int Id { get; set; } |
| | | 12 | | |
| | | 13 | | [Column("NAME")] |
| | | 14 | | [StringLength(100)] |
| | 0 | 15 | | public string Name { get; set; } = string.Empty; |
| | | 16 | | |
| | | 17 | | [Column("BASE")] |
| | | 18 | | [StringLength(1)] |
| | 0 | 19 | | public string Base { get; set; } = "N"; |
| | | 20 | | |
| | | 21 | | [Column("SORT")] |
| | 0 | 22 | | public int Sort { get; set; } = 100; |
| | | 23 | | |
| | | 24 | | [Column("XML_ID")] |
| | | 25 | | [StringLength(255)] |
| | 0 | 26 | | public string? XmlId { get; set; } |
| | | 27 | | |
| | | 28 | | [Column("TIMESTAMP_X")] |
| | 0 | 29 | | public DateTime? TimestampX { get; set; } |
| | | 30 | | |
| | | 31 | | [Column("MODIFIED_BY")] |
| | 0 | 32 | | public long? ModifiedBy { get; set; } |
| | | 33 | | |
| | | 34 | | [Column("DATE_CREATE")] |
| | 0 | 35 | | public DateTime? DateCreate { get; set; } |
| | | 36 | | |
| | | 37 | | [Column("CREATED_BY")] |
| | 0 | 38 | | public long? CreatedBy { get; set; } |
| | | 39 | | |
| | | 40 | | [NotMapped] |
| | 0 | 41 | | public CatalogGroupType GroupType => Id switch |
| | 0 | 42 | | { |
| | 0 | 43 | | 1 => CatalogGroupType.Retail, |
| | 0 | 44 | | 3 => CatalogGroupType.Accounting, |
| | 0 | 45 | | 4 => CatalogGroupType.Sale, |
| | 0 | 46 | | _ => CatalogGroupType.Unknown |
| | 0 | 47 | | }; |
| | | 48 | | |
| | | 49 | | [NotMapped] |
| | 0 | 50 | | public string DisplayNameRu => GroupType switch |
| | 0 | 51 | | { |
| | 0 | 52 | | CatalogGroupType.Retail => "Розничная цена", |
| | 0 | 53 | | CatalogGroupType.Accounting => "Учетная цена", |
| | 0 | 54 | | CatalogGroupType.Sale => "Sale", |
| | 0 | 55 | | _ => Name |
| | 0 | 56 | | }; |
| | | 57 | | } |