| | | 1 | | using Newtonsoft.Json; |
| | | 2 | | |
| | | 3 | | namespace Services.ApiServices._1CApi.OData.Models; |
| | | 4 | | |
| | | 5 | | public class ODataOrganization |
| | | 6 | | { |
| | | 7 | | [JsonProperty("Ref_Key")] public Guid RefKey { get; set; } |
| | | 8 | | [JsonProperty("Description")] public string? Description { get; set; } = string.Empty; |
| | | 9 | | [JsonProperty("ИНН")] public string? Inn { get; set; } = string.Empty; |
| | | 10 | | [JsonProperty("DeletionMark")] public bool DeletionMark { get; set; } |
| | | 11 | | } |
| | | 12 | | |
| | | 13 | | public class ODataCounterparty |
| | | 14 | | { |
| | | 15 | | [JsonProperty("Ref_Key")] public Guid RefKey { get; set; } |
| | | 16 | | [JsonProperty("Description")] public string? Description { get; set; } = string.Empty; |
| | | 17 | | [JsonProperty("ИНН")] public string? Inn { get; set; } = string.Empty; |
| | | 18 | | [JsonProperty("РегистрационныйНомер")] public string? RegistrationNumber { get; set; } = string.Empty; |
| | | 19 | | |
| | | 20 | | public string? Identifier => !string.IsNullOrWhiteSpace(Inn) ? Inn : RegistrationNumber; |
| | | 21 | | } |
| | | 22 | | |
| | | 23 | | public class ODataWarehouse |
| | | 24 | | { |
| | | 25 | | [JsonProperty("Ref_Key")] public Guid RefKey { get; set; } |
| | | 26 | | [JsonProperty("Description")] public string? Description { get; set; } = string.Empty; |
| | | 27 | | } |
| | | 28 | | |
| | | 29 | | public class ODataNomenclature |
| | | 30 | | { |
| | | 31 | | [JsonProperty("Ref_Key")] public Guid RefKey { get; set; } |
| | | 32 | | [JsonProperty("Description")] public string? Description { get; set; } = string.Empty; |
| | | 33 | | [JsonProperty("Артикул")] public string? Article { get; set; } = string.Empty; |
| | | 34 | | [JsonProperty("IsFolder")] public bool IsFolder { get; set; } |
| | | 35 | | |
| | | 36 | | /// <summary>Заполняется только в выборках сверки — признак того, что карточка пригодна для проведения.</summary> |
| | | 37 | | [JsonProperty("СчетУчетаЗапасов_Key")] public Guid? StockAccountKey { get; set; } |
| | | 38 | | } |
| | | 39 | | |
| | | 40 | | /// <summary> |
| | | 41 | | /// Строка табличной части «ДополнительныеРеквизиты» справочника номенклатуры. |
| | | 42 | | /// Отдельный OData-эндпоинт позволяет выгрузить производителей всех карточек одним запросом, |
| | | 43 | | /// вместо чтения каждой карточки по Ref_Key. |
| | | 44 | | /// </summary> |
| | | 45 | | public class ODataNomenclatureProperty |
| | | 46 | | { |
| | 0 | 47 | | [JsonProperty("Ref_Key")] public Guid RefKey { get; set; } |
| | 0 | 48 | | [JsonProperty("Свойство_Key")] public Guid PropertyKey { get; set; } |
| | 0 | 49 | | [JsonProperty("Значение")] public string? Value { get; set; } = string.Empty; |
| | | 50 | | } |
| | | 51 | | |
| | | 52 | | public class ODataPropertyValue |
| | | 53 | | { |
| | | 54 | | [JsonProperty("Ref_Key")] public Guid RefKey { get; set; } |
| | | 55 | | [JsonProperty("Description")] public string? Description { get; set; } = string.Empty; |
| | | 56 | | [JsonProperty("Owner_Key")] public Guid OwnerKey { get; set; } |
| | | 57 | | [JsonProperty("DeletionMark")] public bool DeletionMark { get; set; } |
| | | 58 | | } |
| | | 59 | | |
| | | 60 | | public class ODataVatRate |
| | | 61 | | { |
| | | 62 | | [JsonProperty("Ref_Key")] public Guid RefKey { get; set; } |
| | | 63 | | [JsonProperty("Description")] public string? Description { get; set; } = string.Empty; |
| | | 64 | | } |
| | | 65 | | |
| | | 66 | | public class ODataContract |
| | | 67 | | { |
| | | 68 | | [JsonProperty("Ref_Key")] public Guid RefKey { get; set; } |
| | | 69 | | [JsonProperty("Description")] public string? Description { get; set; } = string.Empty; |
| | | 70 | | [JsonProperty("Owner")] public Guid Owner { get; set; } |
| | | 71 | | /// <summary>Организация договора; null/пустой GUID — договор не привязан к организации (годится для любой).</summar |
| | | 72 | | [JsonProperty("Организация_Key")] public Guid? OrganizationKey { get; set; } |
| | | 73 | | } |
| | | 74 | | |
| | | 75 | | public class ODataCountry |
| | | 76 | | { |
| | | 77 | | [JsonProperty("Ref_Key")] public Guid RefKey { get; set; } |
| | | 78 | | [JsonProperty("Description")] public string? Description { get; set; } = string.Empty; |
| | | 79 | | } |
| | | 80 | | |
| | | 81 | | public class ODataGtdCode |
| | | 82 | | { |
| | | 83 | | [JsonProperty("Ref_Key")] public Guid RefKey { get; set; } |
| | | 84 | | [JsonProperty("Description")] public string? Description { get; set; } = string.Empty; |
| | | 85 | | [JsonProperty("РегистрационныйНомер")] public string? RegistrationNumber { get; set; } = string.Empty; |
| | | 86 | | } |
| | | 87 | | |
| | | 88 | | public class ODataListResponse<T> |
| | | 89 | | { |
| | | 90 | | [JsonProperty("value")] public List<T>? Value { get; set; } = new(); |
| | | 91 | | } |
| | | 92 | | |
| | | 93 | | public class ODataErrorResponse |
| | | 94 | | { |
| | | 95 | | [JsonProperty("odata.error")] public ODataErrorDetail? Error { get; set; } |
| | | 96 | | } |
| | | 97 | | |
| | | 98 | | public class ODataErrorDetail |
| | | 99 | | { |
| | | 100 | | [JsonProperty("code")] public string? Code { get; set; } |
| | | 101 | | [JsonProperty("message")] public ODataErrorMessage? Message { get; set; } |
| | | 102 | | } |
| | | 103 | | |
| | | 104 | | public class ODataErrorMessage |
| | | 105 | | { |
| | | 106 | | [JsonProperty("lang")] public string? Lang { get; set; } |
| | | 107 | | [JsonProperty("value")] public string? Value { get; set; } |
| | | 108 | | } |