@pedro.araujo/ml-architecture-shared 0.1.33 → 0.1.35

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.
@@ -1,10 +1,11 @@
1
+ import { CreateAuctionSessionRequestDTO } from "../auction-session/create-auction-sequence-request.dto.js";
1
2
  export interface CreateAuctionItemDTO {
2
3
  title: string;
3
4
  auctionLink: string;
4
5
  itemTypeId: number;
5
6
  auctionTypeId: number;
6
7
  authorityId: number | null;
7
- sessions: string[];
8
+ sessions: CreateAuctionSessionRequestDTO[];
8
9
  jurisdiction: string | null;
9
10
  appraisalValue: number | null;
10
11
  minimumBid: number | null;
@@ -1 +1 @@
1
- {"version":3,"file":"create-auction-item.dto.d.ts","sourceRoot":"","sources":["../../src/auction-item/create-auction-item.dto.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IAEpB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,MAAM,EAAE,CAAC;IAEnB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,mBAAmB,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CACtC"}
1
+ {"version":3,"file":"create-auction-item.dto.d.ts","sourceRoot":"","sources":["../../src/auction-item/create-auction-item.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,2DAA2D,CAAC;AAE3G,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IAEpB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,8BAA8B,EAAE,CAAC;IAE3C,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,mBAAmB,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CACtC"}
@@ -1 +1 @@
1
- {"version":3,"file":"create-auction-item.schema.d.ts","sourceRoot":"","sources":["../../src/auction-item/create-auction-item.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,eAAO,MAAM,uBAAuB,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAgBhE,CAAC"}
1
+ {"version":3,"file":"create-auction-item.schema.d.ts","sourceRoot":"","sources":["../../src/auction-item/create-auction-item.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAGzE,eAAO,MAAM,uBAAuB,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAwChE,CAAC"}
@@ -1,11 +1,33 @@
1
1
  import { z } from "zod";
2
+ import { CreateAuctionSessionRequestSchema } from "../auction-session/create-auction-sequence-request.schema.js";
2
3
  export const CreateAuctionItemSchema = z.object({
3
4
  title: z.string().min(2).max(255),
4
5
  auctionLink: z.url().max(2048),
5
6
  itemTypeId: z.number().int().positive(),
6
7
  auctionTypeId: z.number().int().positive(),
7
8
  authorityId: z.number().int().nullable(),
8
- sessions: z.array(z.iso.datetime()).min(1).max(3),
9
+ sessions: z.array(CreateAuctionSessionRequestSchema)
10
+ .min(1)
11
+ .max(3)
12
+ .superRefine((sessions, ctx) => {
13
+ const sequences = sessions.map(s => s.sequence);
14
+ const unique = new Set(sequences);
15
+ if (unique.size !== sequences.length) {
16
+ ctx.addIssue({
17
+ code: z.ZodIssueCode.custom,
18
+ message: "Duplicate auction session sequence",
19
+ });
20
+ }
21
+ const max = Math.max(...sequences);
22
+ for (let i = 1; i <= max; i++) {
23
+ if (!sequences.includes(i)) {
24
+ ctx.addIssue({
25
+ code: z.ZodIssueCode.custom,
26
+ message: `Missing auction session sequence ${i}`,
27
+ });
28
+ }
29
+ }
30
+ }),
9
31
  jurisdiction: z.string().max(100).nullable(),
10
32
  appraisalValue: z.number().positive().nullable(),
11
33
  minimumBid: z.number().positive().nullable(),
@@ -0,0 +1,5 @@
1
+ export interface CreateAuctionSessionRequestDTO {
2
+ sequence: number;
3
+ scheduledAt: string;
4
+ }
5
+ //# sourceMappingURL=create-auction-sequence-request.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-auction-sequence-request.dto.d.ts","sourceRoot":"","sources":["../../src/auction-session/create-auction-sequence-request.dto.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB"}
@@ -0,0 +1,6 @@
1
+ import { z } from "zod";
2
+ export declare const CreateAuctionSessionRequestSchema: z.ZodObject<{
3
+ sequence: z.ZodNumber;
4
+ scheduledAt: z.ZodISODateTime;
5
+ }, z.core.$strip>;
6
+ //# sourceMappingURL=create-auction-sequence-request.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-auction-sequence-request.schema.d.ts","sourceRoot":"","sources":["../../src/auction-session/create-auction-sequence-request.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,iCAAiC;;;iBAG5C,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { z } from "zod";
2
+ export const CreateAuctionSessionRequestSchema = z.object({
3
+ sequence: z.number().int().positive(),
4
+ scheduledAt: z.iso.datetime(),
5
+ });
@@ -1,7 +1,9 @@
1
+ import { UserResponseDTO } from "../user/user-response.dto.js";
1
2
  export interface BidResponseDTO {
2
3
  id: number;
3
4
  date: string;
4
5
  amount: number;
5
6
  note: string;
7
+ createdBy: UserResponseDTO;
6
8
  }
7
9
  //# sourceMappingURL=bid-response.dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bid-response.dto.d.ts","sourceRoot":"","sources":["../../src/bid/bid-response.dto.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd"}
1
+ {"version":3,"file":"bid-response.dto.d.ts","sourceRoot":"","sources":["../../src/bid/bid-response.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,eAAe,CAAC;CAC5B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pedro.araujo/ml-architecture-shared",
3
- "version": "0.1.33",
3
+ "version": "0.1.35",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",