|
1 | 1 | // Copyright © Anointed Automation, LLC., 2024. All Rights Reserved. Created by Alexander Fields https://www.alexanderfields.me on 2024-01-16 19:19:01 |
2 | 2 | // Edited by Alexander Fields https://www.alexanderfields.me 2025-07-02 11:48:25 |
3 | 3 |
|
4 | | -using System.Collections.Generic; |
5 | | -using System.Runtime.Serialization; |
| 4 | +// ============================================================================= |
| 5 | +// NAMING CONVENTION: |
| 6 | +// This codebase follows a specific property naming pattern: |
| 7 | +// - Value types (structs): lowercase (e.g., bool success, int statusCode) |
| 8 | +// - Reference types (objects): PascalCase (e.g., string Message, object Data) |
| 9 | +// ============================================================================= |
| 10 | + |
| 11 | +using BaseBill = AnointedAutomation.Objects.Billing.Bill; |
6 | 12 |
|
7 | 13 | namespace AnointedAutomation.Objects.API.Billing |
8 | 14 | { |
9 | | - public class Bill |
| 15 | + /// <summary> |
| 16 | + /// API-specific bill class. Inherits all properties from the base Bill class. |
| 17 | + /// </summary> |
| 18 | + public class Bill : BaseBill |
10 | 19 | { |
11 | 20 | public Bill() |
12 | | - { |
13 | | - } |
14 | | - |
15 | | - public Bill(string userId, Address addressBilling, List<string> orders, PaymentCredentials paymentTypes, List<Purchase> purchases, List<Purchase> refunds, List<Subscription> subscriptions) |
16 | | - { |
17 | | - this._id = userId; |
18 | | - this.AdressBilling = addressBilling ?? new Address(); |
19 | | - this.Orders = orders ?? new List<string>(); |
20 | | - this.PaymentTypesOnFile = paymentTypes ?? new PaymentCredentials(); |
21 | | - this.Purchases = purchases ?? new List<Purchase>(); |
22 | | - this.Refunds = refunds ?? new List<Purchase>(); |
23 | | - this.Subscriptions = subscriptions ?? new List<Subscription>(); |
24 | | - } |
25 | | - |
26 | | - [DataMember] |
27 | | - public string _id { get; set; } |
28 | | - |
29 | | - /// <summary> |
30 | | - /// Keep a billign address on file |
31 | | - /// </summary> |
32 | | - [DataMember] |
33 | | - public Address AdressBilling |
34 | | - { |
35 | | - get; set; |
36 | | - } |
37 | | - |
38 | | - [DataMember] |
39 | | - public List<string> Orders |
40 | | - { |
41 | | - get; set; |
42 | | - } |
43 | | - |
44 | | - /// <summary> |
45 | | - /// Credit cards, billing, etc |
46 | | - /// </summary> |
47 | | - [DataMember] |
48 | | - public PaymentCredentials PaymentTypesOnFile |
49 | | - { |
50 | | - get; set; |
51 | | - } |
52 | | - |
53 | | - /// <summary> |
54 | | - /// All purchases made |
55 | | - /// </summary> |
56 | | - [DataMember] |
57 | | - public List<Purchase> Purchases |
58 | | - { |
59 | | - get; set; |
60 | | - } |
61 | | - |
62 | | - /// <summary> |
63 | | - /// Purchases that have been refunded |
64 | | - /// </summary> |
65 | | - [DataMember] |
66 | | - public List<Purchase> Refunds |
67 | | - { |
68 | | - get; set; |
69 | | - } |
70 | | - |
71 | | - /// <summary> |
72 | | - /// Subscriptions |
73 | | - /// </summary> |
74 | | - [DataMember] |
75 | | - public List<Subscription> Subscriptions |
76 | | - { |
77 | | - get; set; |
78 | | - } |
| 21 | + : base() |
| 22 | + { } |
79 | 23 |
|
80 | | - public dynamic GetPrimaryPayment() |
81 | | - { |
82 | | - if (PaymentTypesOnFile.CreditCard != null) |
83 | | - { |
84 | | - return PaymentTypesOnFile.CreditCard; |
85 | | - } |
86 | | - else if (PaymentTypesOnFile.PayeeInfo != null) |
87 | | - { |
88 | | - return PaymentTypesOnFile.PayeeInfo; |
89 | | - } |
90 | | - else |
91 | | - return null; |
92 | | - } |
| 24 | + public Bill(string userId, AnointedAutomation.Objects.Billing.Address addressBilling, System.Collections.Generic.List<string> orders, AnointedAutomation.Objects.Billing.PaymentCredentials paymentTypes, System.Collections.Generic.List<AnointedAutomation.Objects.Billing.Purchase> purchases, System.Collections.Generic.List<AnointedAutomation.Objects.Billing.Purchase> refunds, System.Collections.Generic.List<AnointedAutomation.Objects.Billing.Subscription> subscriptions) |
| 25 | + : base(userId, addressBilling, orders, paymentTypes, purchases, refunds, subscriptions) |
| 26 | + { } |
93 | 27 | } |
94 | 28 | } |
0 commit comments