@things-factory/integration-barobill 10.1.288 → 10.1.291

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,8 +5,10 @@
5
5
  * How they come, read from the production server's IBK-issued BC card answers (2026-11-16):
6
6
  * - `HistoryKey` is the purchase's own key; `ApprovalNum` and `ApprovalType` say which approval or cancel it settles.
7
7
  * - `ApprovalDT` is the approval's time; `UseDate` is the purchase day (the day after the approval, as a rule).
8
- * - `ApprovalAmount` is the amount in the card's currency, `ForeignApprovalAmount` the won of a foreign one - as the
9
- * approvals. `Amount` comes 0; `Tax` is the VAT.
8
+ * - `ApprovalAmount` is the won the company pays, a foreign purchase's too; `ForeignApprovalAmount` is a foreign
9
+ * purchase's amount in its currency - the other way round from the approvals (2026-11-18: four USD purchases of
10
+ * 2026-10-21 ~ 11-02, e.g. approval 17,635 won, purchase `ApprovalAmount` 17842 · `ForeignApprovalAmount` 13.33).
11
+ * `Amount` comes 0; `Tax` is the VAT.
10
12
  * - `IsPurchased` came true on every row.
11
13
  */
12
14
  export interface CardPurchaseLine {
@@ -17,7 +19,7 @@ export interface CardPurchaseLine {
17
19
  approvedLocalTime: string;
18
20
  /** 'YYYY-MM-DD' */
19
21
  purchasedOn: string;
20
- /** Won, always positive; null when a foreign purchase has no won yet. */
22
+ /** Won, always positive - a foreign purchase's too. */
21
23
  amount: number | null;
22
24
  taxAmount: number | null;
23
25
  currency: string | null;
@@ -17,8 +17,8 @@ function cardPurchasesOf(cardNumber, items, period) {
17
17
  throw new Error(`Barobill answered a purchase of card ${own} for card ${card}`);
18
18
  const currency = text(item.CurrencyCode) ?? 'KRW';
19
19
  const abroad = currency !== 'KRW';
20
- const charged = Math.abs((0, bank_lines_1.moneyOf)(item.ApprovalAmount, 'purchase amount'));
21
- const won = abroad ? (text(item.ForeignApprovalAmount) === null ? null : Math.abs((0, bank_lines_1.moneyOf)(item.ForeignApprovalAmount, 'won amount'))) : charged;
20
+ const won = Math.abs((0, bank_lines_1.moneyOf)(item.ApprovalAmount, 'purchase amount'));
21
+ const foreign = abroad && text(item.ForeignApprovalAmount) !== null ? Math.abs((0, bank_lines_1.moneyOf)(item.ForeignApprovalAmount, 'foreign amount')) : null;
22
22
  const tax = abroad || text(item.Tax) === null ? null : Math.abs((0, bank_lines_1.moneyOf)(item.Tax, 'tax'));
23
23
  return {
24
24
  historyKey: String(item.HistoryKey ?? '').trim(),
@@ -29,7 +29,7 @@ function cardPurchasesOf(cardNumber, items, period) {
29
29
  amount: won,
30
30
  taxAmount: tax,
31
31
  currency: abroad ? currency : null,
32
- foreignAmount: abroad ? charged : null
32
+ foreignAmount: foreign
33
33
  };
34
34
  });
35
35
  for (const line of lines) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/integration-barobill",
3
- "version": "10.1.288",
3
+ "version": "10.1.291",
4
4
  "main": "dist-server/index.js",
5
5
  "files": [
6
6
  "README.md",
@@ -36,8 +36,8 @@
36
36
  "probe": "tsc -p tsconfig.json && node scripts/probe.mjs"
37
37
  },
38
38
  "dependencies": {
39
- "@things-factory/integration-base": "^10.1.283",
40
- "@things-factory/shell": "^10.1.283"
39
+ "@things-factory/integration-base": "^10.1.291",
40
+ "@things-factory/shell": "^10.1.291"
41
41
  },
42
- "gitHead": "78eaee46dd9b425ed845b02952b082f35a0faca7"
42
+ "gitHead": "994bc91b2d71513039c204560bb0571baa92ca0b"
43
43
  }