@endevops/peppol-schema 0.1.0-beta.3 → 0.1.0-beta.4

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/SchemaStore/schemastore/refs/heads/master/src/schemas/json/package.json",
3
3
  "name": "@endevops/peppol-schema",
4
- "version": "0.1.0-beta.3",
4
+ "version": "0.1.0-beta.4",
5
5
  "description": "A simple example library built by tsdown",
6
6
  "license": "Apache-2.0",
7
7
  "contributors": [
@@ -111,4 +111,4 @@ export const peppolAdditionalDocumentReferenceSchema = peppolIdentifierSchema.pi
111
111
  })
112
112
  );
113
113
 
114
- export type PeppolAdditionalDocumentReference = typeof peppolAdditionalDocumentReferenceSchema.Type;
114
+ export interface PeppolAdditionalDocumentReference extends Schema.Schema.Type<typeof peppolAdditionalDocumentReferenceSchema> {}
@@ -91,4 +91,5 @@ export const peppolAllowanceChargeSchema = Schema.Union([
91
91
  ),
92
92
  ]).annotate({ message: 'unable to decode allowance charge' });
93
93
 
94
- export type PeppolAllowanceCharge = typeof peppolAllowanceChargeSchema.Type;
94
+ export type PeppolAllowanceCharge = Schema.Schema.Type<typeof peppolAllowanceChargeSchema>;
95
+ export type PeppolAllowanceChargeEncoded = Schema.Codec.Encoded<typeof peppolAllowanceChargeSchema>;
@@ -18,4 +18,5 @@ export const peppolAmountSchema = Schema.Struct({
18
18
  value: Schema.Finite,
19
19
  });
20
20
 
21
- export type PeppolAmount = typeof peppolAmountSchema.Type;
21
+ export interface PeppolAmount extends Schema.Schema.Type<typeof peppolAmountSchema> {}
22
+ export interface PeppolAmountEncoded extends Schema.Codec.Encoded<typeof peppolAmountSchema> {}
@@ -39,3 +39,4 @@ export const peppolCreditNoteLineSchema = peppolBaseLineSchema.pipe(
39
39
  );
40
40
 
41
41
  export interface PeppolCreditNoteLine extends Schema.Schema.Type<typeof peppolCreditNoteLineSchema> {}
42
+ export interface PeppolCreditNoteLineEncoded extends Schema.Codec.Encoded<typeof peppolCreditNoteLineSchema> {}
@@ -43,3 +43,4 @@ export const peppolInvoiceLineSchema = peppolBaseLineSchema.pipe(
43
43
  );
44
44
 
45
45
  export interface PeppolInvoiceLine extends Schema.Schema.Type<typeof peppolInvoiceLineSchema> {}
46
+ export interface PeppolInvoiceLineEncoded extends Schema.Codec.Encoded<typeof peppolInvoiceLineSchema> {}
@@ -59,5 +59,6 @@ export const peppolLineAllowanceChargeSchema = Schema.Union([
59
59
  ]).annotate({ message: 'unable to decode line allowance charge' });
60
60
 
61
61
  export type PeppolLineAllowanceCharge = typeof peppolLineAllowanceChargeSchema.Type;
62
+ export type PeppolLineAllowanceChargeEncoded = typeof peppolLineAllowanceChargeSchema.Encoded;
62
63
 
63
64
  export { baseLineAllowanceChargeSchema };
@@ -8,6 +8,30 @@ import { peppolPartyTaxSchemeSchema } from '#/effect/fields/peppol-party-tax-sch
8
8
  import { electronicCodesSchema } from '#/effect/values/electronic-codes-schema';
9
9
  import { icdCodesSchema } from '#/effect/values/icd-codes-schema';
10
10
 
11
+ export const peppolPartyEndpointIdSchema = peppolIdentifierSchema.pipe(
12
+ Schema.fieldsAssign({
13
+ /**
14
+ * @description Identifies the Seller/buyer's electronic address to which the application level response to the invoice may be delivered.
15
+ *
16
+ * @example
17
+ * 7300010000001;
18
+ *
19
+ * @summary Seller/Buyer electronic address
20
+ *
21
+ * @name `#text`
22
+ */
23
+ id: Schema.String,
24
+ /**
25
+ * @description The identification scheme identifier of the Seller/Buyer electronic address.
26
+ *
27
+ * @summary Seller/Buyer electronic address identification scheme identifier
28
+ *
29
+ * @name `@schemeID`
30
+ */
31
+ schemeId: electronicCodesSchema,
32
+ })
33
+ );
34
+
11
35
  /**
12
36
  * @summary Party common substructure
13
37
  *
@@ -24,29 +48,7 @@ export const peppolPartyBaseSchema = Schema.Struct({
24
48
  *
25
49
  * @name `cbc:EndpointID`
26
50
  */
27
- endpointId: peppolIdentifierSchema.pipe(
28
- Schema.fieldsAssign({
29
- /**
30
- * @description Identifies the Seller/buyer's electronic address to which the application level response to the invoice may be delivered.
31
- *
32
- * @example
33
- * 7300010000001;
34
- *
35
- * @summary Seller/Buyer electronic address
36
- *
37
- * @name `#text`
38
- */
39
- id: Schema.String,
40
- /**
41
- * @description The identification scheme identifier of the Seller/Buyer electronic address.
42
- *
43
- * @summary Seller/Buyer electronic address identification scheme identifier
44
- *
45
- * @name `@schemeID`
46
- */
47
- schemeId: electronicCodesSchema,
48
- })
49
- ),
51
+ endpointId: peppolPartyEndpointIdSchema,
50
52
  /**
51
53
  * @example
52
54
  * 5060012349998;
@@ -26,4 +26,5 @@ export const peppolTaxSubtotalCategorySchema = peppolTaxCategorySchema.pipe(
26
26
  })
27
27
  );
28
28
 
29
- export type PeppolTaxSubTotalCategory = typeof peppolTaxSubtotalCategorySchema.Type;
29
+ export interface PeppolTaxSubTotalCategory extends Schema.Schema.Type<typeof peppolTaxSubtotalCategorySchema> {}
30
+ export interface PeppolTaxSubTotalCategoryEncoded extends Schema.Codec.Encoded<typeof peppolTaxSubtotalCategorySchema> {}
@@ -127,7 +127,7 @@ export const peppolDocumentSchema = peppolDocumentObjectSchema.pipe(
127
127
  })
128
128
  );
129
129
 
130
- export type PeppolDocumentEncoded = string;
130
+ export type PeppolDocumentEncoded = Schema.Codec.Encoded<typeof peppolDocumentSchema>;
131
131
  export interface PeppolDocumentDecoded extends AllUnionFields<Schema.Schema.Type<typeof peppolDocumentSchema>> {}
132
132
 
133
133
  /**
@@ -14,7 +14,13 @@ import { currencyCodesKeys } from '#/values/currency-code.generated';
14
14
  *
15
15
  * @see https://docs.peppol.eu/poacc/billing/3.0/codelist/ISO4217/
16
16
  */
17
- export type PeppolCurrencyCode = typeof currencyCodeSchema.Type;
17
+ export type PeppolCurrencyCode = Schema.Schema.Type<typeof currencyCodeSchema>;
18
+ /**
19
+ * @description An ISO 4217 currency code as defined by the PEPPOL subset.
20
+ *
21
+ * @see https://docs.peppol.eu/poacc/billing/3.0/codelist/ISO4217/
22
+ */
23
+ export type PeppolCurrencyCodeEncoded = Schema.Codec.Encoded<typeof currencyCodeSchema>;
18
24
 
19
25
  /**
20
26
  * @description Validates an ISO 4217 currency code against the PEPPOL codelist.
@@ -8,6 +8,7 @@ import { dutyTaxFeeCategoriesKeys } from '#/values/duty-tax-fee-categories.gener
8
8
  * @see https://docs.peppol.eu/poacc/billing/3.0/codelist/UNCL5305/
9
9
  */
10
10
  export type PeppolDutyTaxFeeCategoryCode = typeof dutyTaxFeeCategorySchema.Type;
11
+ export type PeppolDutyTaxFeeCategoryCodeEncoded = typeof dutyTaxFeeCategorySchema.Encoded;
11
12
 
12
13
  /**
13
14
  * @description Validates a duty, tax or fee category code against the PEPPOL subset of UNCL 5305 (VAT category code).