@voyantjs/suppliers 0.6.9 → 0.7.0
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/dist/routes.d.ts +22 -0
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +9 -1
- package/dist/service-aggregates.d.ts +23 -0
- package/dist/service-aggregates.d.ts.map +1 -0
- package/dist/service-aggregates.js +50 -0
- package/dist/service.d.ts +2 -0
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +2 -0
- package/dist/validation.d.ts +4 -0
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +4 -0
- package/package.json +6 -6
package/dist/routes.d.ts
CHANGED
|
@@ -6,6 +6,28 @@ type Env = {
|
|
|
6
6
|
};
|
|
7
7
|
};
|
|
8
8
|
export declare const supplierRoutes: import("hono/hono-base").HonoBase<Env, {
|
|
9
|
+
"/aggregates": {
|
|
10
|
+
$get: {
|
|
11
|
+
input: {};
|
|
12
|
+
output: {
|
|
13
|
+
data: {
|
|
14
|
+
total: number;
|
|
15
|
+
countsByStatus: {
|
|
16
|
+
status: "pending" | "active" | "inactive";
|
|
17
|
+
count: number;
|
|
18
|
+
}[];
|
|
19
|
+
countsByType: {
|
|
20
|
+
type: "other" | "hotel" | "restaurant" | "transfer" | "guide" | "experience" | "airline";
|
|
21
|
+
count: number;
|
|
22
|
+
}[];
|
|
23
|
+
active: number;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
outputFormat: "json";
|
|
27
|
+
status: import("hono/utils/http-status").ContentfulStatusCode;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
} & {
|
|
9
31
|
"/": {
|
|
10
32
|
$get: {
|
|
11
33
|
input: {};
|
package/dist/routes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,kBAAkB,EAAE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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCA+ZvB,CAAA;AAEJ,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAA"}
|
package/dist/routes.js
CHANGED
|
@@ -3,11 +3,19 @@ import { insertAddressForEntitySchema, insertContactPointForEntitySchema, insert
|
|
|
3
3
|
import { Hono } from "hono";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { suppliersService } from "./service.js";
|
|
6
|
-
import { availabilityQuerySchema, insertAvailabilitySchema, insertContractSchema, insertRateSchema, insertServiceSchema, insertSupplierNoteSchema, insertSupplierSchema, supplierListQuerySchema, updateContractSchema, updateRateSchema, updateServiceSchema, updateSupplierSchema, } from "./validation.js";
|
|
6
|
+
import { availabilityQuerySchema, insertAvailabilitySchema, insertContractSchema, insertRateSchema, insertServiceSchema, insertSupplierNoteSchema, insertSupplierSchema, supplierAggregatesQuerySchema, supplierListQuerySchema, updateContractSchema, updateRateSchema, updateServiceSchema, updateSupplierSchema, } from "./validation.js";
|
|
7
7
|
// ==========================================================================
|
|
8
8
|
// Suppliers — method-chained for Hono RPC type inference
|
|
9
9
|
// ==========================================================================
|
|
10
10
|
export const supplierRoutes = new Hono()
|
|
11
|
+
// ========================================================================
|
|
12
|
+
// Dashboard aggregates
|
|
13
|
+
// ========================================================================
|
|
14
|
+
// GET /aggregates — dashboard KPIs (before /:id so the matcher doesn't swallow it)
|
|
15
|
+
.get("/aggregates", async (c) => {
|
|
16
|
+
const query = parseQuery(c, supplierAggregatesQuerySchema);
|
|
17
|
+
return c.json({ data: await suppliersService.getSupplierAggregates(c.get("db"), query) });
|
|
18
|
+
})
|
|
11
19
|
// ========================================================================
|
|
12
20
|
// Suppliers CRUD
|
|
13
21
|
// ========================================================================
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
|
|
2
|
+
import { suppliers } from "./schema.js";
|
|
3
|
+
type SupplierStatus = (typeof suppliers.$inferSelect)["status"];
|
|
4
|
+
type SupplierType = (typeof suppliers.$inferSelect)["type"];
|
|
5
|
+
export interface SupplierAggregates {
|
|
6
|
+
total: number;
|
|
7
|
+
countsByStatus: Array<{
|
|
8
|
+
status: SupplierStatus;
|
|
9
|
+
count: number;
|
|
10
|
+
}>;
|
|
11
|
+
countsByType: Array<{
|
|
12
|
+
type: SupplierType;
|
|
13
|
+
count: number;
|
|
14
|
+
}>;
|
|
15
|
+
/** Shorthand for the `active` bucket — dashboard KPI card. */
|
|
16
|
+
active: number;
|
|
17
|
+
}
|
|
18
|
+
export declare function getSupplierAggregates(db: PostgresJsDatabase, options?: {
|
|
19
|
+
from?: string;
|
|
20
|
+
to?: string;
|
|
21
|
+
}): Promise<SupplierAggregates>;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=service-aggregates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-aggregates.d.ts","sourceRoot":"","sources":["../src/service-aggregates.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAEjE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,KAAK,cAAc,GAAG,CAAC,OAAO,SAAS,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAA;AAC/D,KAAK,YAAY,GAAG,CAAC,OAAO,SAAS,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAA;AAa3D,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,cAAc,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,cAAc,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAChE,YAAY,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,YAAY,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAC1D,8DAA8D;IAC9D,MAAM,EAAE,MAAM,CAAA;CACf;AAED,wBAAsB,qBAAqB,CACzC,EAAE,EAAE,kBAAkB,EACtB,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAO,GAC3C,OAAO,CAAC,kBAAkB,CAAC,CAyC7B"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { and, sql } from "drizzle-orm";
|
|
2
|
+
import { suppliers } from "./schema.js";
|
|
3
|
+
const ALL_SUPPLIER_STATUSES = ["active", "inactive", "pending"];
|
|
4
|
+
const ALL_SUPPLIER_TYPES = [
|
|
5
|
+
"hotel",
|
|
6
|
+
"transfer",
|
|
7
|
+
"guide",
|
|
8
|
+
"experience",
|
|
9
|
+
"airline",
|
|
10
|
+
"restaurant",
|
|
11
|
+
"other",
|
|
12
|
+
];
|
|
13
|
+
export async function getSupplierAggregates(db, options = {}) {
|
|
14
|
+
const fromDate = options.from ? new Date(options.from) : undefined;
|
|
15
|
+
const toDate = options.to ? new Date(options.to) : undefined;
|
|
16
|
+
const rangeConditions = [];
|
|
17
|
+
if (fromDate)
|
|
18
|
+
rangeConditions.push(sql `${suppliers.createdAt} >= ${fromDate}`);
|
|
19
|
+
if (toDate)
|
|
20
|
+
rangeConditions.push(sql `${suppliers.createdAt} < ${toDate}`);
|
|
21
|
+
const rangeWhere = rangeConditions.length ? and(...rangeConditions) : undefined;
|
|
22
|
+
const [totalRow] = await db
|
|
23
|
+
.select({ count: sql `count(*)::int` })
|
|
24
|
+
.from(suppliers)
|
|
25
|
+
.where(rangeWhere);
|
|
26
|
+
const statusRows = await db
|
|
27
|
+
.select({ status: suppliers.status, count: sql `count(*)::int` })
|
|
28
|
+
.from(suppliers)
|
|
29
|
+
.where(rangeWhere)
|
|
30
|
+
.groupBy(suppliers.status);
|
|
31
|
+
const typeRows = await db
|
|
32
|
+
.select({ type: suppliers.type, count: sql `count(*)::int` })
|
|
33
|
+
.from(suppliers)
|
|
34
|
+
.where(rangeWhere)
|
|
35
|
+
.groupBy(suppliers.type);
|
|
36
|
+
const statusMap = new Map(statusRows.map((r) => [r.status, r.count]));
|
|
37
|
+
const typeMap = new Map(typeRows.map((r) => [r.type, r.count]));
|
|
38
|
+
return {
|
|
39
|
+
total: totalRow?.count ?? 0,
|
|
40
|
+
countsByStatus: ALL_SUPPLIER_STATUSES.map((status) => ({
|
|
41
|
+
status,
|
|
42
|
+
count: statusMap.get(status) ?? 0,
|
|
43
|
+
})),
|
|
44
|
+
countsByType: ALL_SUPPLIER_TYPES.map((type) => ({
|
|
45
|
+
type,
|
|
46
|
+
count: typeMap.get(type) ?? 0,
|
|
47
|
+
})),
|
|
48
|
+
active: statusMap.get("active") ?? 0,
|
|
49
|
+
};
|
|
50
|
+
}
|
package/dist/service.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { getSupplierAggregates } from "./service-aggregates.js";
|
|
1
2
|
import { createSupplier, deleteSupplier, getSupplierById, listSuppliers, updateSupplier } from "./service-core.js";
|
|
2
3
|
import { createAddress, createContactPoint, createNamedContact, deleteAddress, deleteContactPoint, deleteNamedContact, listAddresses, listContactPoints, listNamedContacts, updateAddress, updateContactPoint, updateNamedContact } from "./service-identity.js";
|
|
3
4
|
import { createAvailability, createContract, createNote, createRate, createService, deleteContract, deleteRate, deleteService, listAvailability, listContracts, listNotes, listRates, listServices, updateContract, updateRate, updateService } from "./service-operations.js";
|
|
4
5
|
export declare const suppliersService: {
|
|
6
|
+
getSupplierAggregates: typeof getSupplierAggregates;
|
|
5
7
|
listSuppliers: typeof listSuppliers;
|
|
6
8
|
getSupplierById: typeof getSupplierById;
|
|
7
9
|
createSupplier: typeof createSupplier;
|
package/dist/service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,cAAc,EACd,eAAe,EACf,aAAa,EACb,cAAc,EACf,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,UAAU,EACV,UAAU,EACV,aAAa,EACb,cAAc,EACd,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,SAAS,EACT,YAAY,EACZ,cAAc,EACd,UAAU,EACV,aAAa,EACd,MAAM,yBAAyB,CAAA;AAEhC,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EACL,cAAc,EACd,cAAc,EACd,eAAe,EACf,aAAa,EACb,cAAc,EACf,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,UAAU,EACV,UAAU,EACV,aAAa,EACb,cAAc,EACd,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,SAAS,EACT,YAAY,EACZ,cAAc,EACd,UAAU,EACV,aAAa,EACd,MAAM,yBAAyB,CAAA;AAEhC,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmC5B,CAAA"}
|
package/dist/service.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { getSupplierAggregates } from "./service-aggregates.js";
|
|
1
2
|
import { createSupplier, deleteSupplier, getSupplierById, listSuppliers, updateSupplier, } from "./service-core.js";
|
|
2
3
|
import { createAddress, createContactPoint, createNamedContact, deleteAddress, deleteContactPoint, deleteNamedContact, listAddresses, listContactPoints, listNamedContacts, updateAddress, updateContactPoint, updateNamedContact, } from "./service-identity.js";
|
|
3
4
|
import { createAvailability, createContract, createNote, createRate, createService, deleteContract, deleteRate, deleteService, listAvailability, listContracts, listNotes, listRates, listServices, updateContract, updateRate, updateService, } from "./service-operations.js";
|
|
4
5
|
export const suppliersService = {
|
|
6
|
+
getSupplierAggregates,
|
|
5
7
|
listSuppliers,
|
|
6
8
|
getSupplierById,
|
|
7
9
|
createSupplier,
|
package/dist/validation.d.ts
CHANGED
|
@@ -115,6 +115,10 @@ export declare const supplierListQuerySchema: z.ZodObject<{
|
|
|
115
115
|
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
116
116
|
offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
117
117
|
}, z.core.$strip>;
|
|
118
|
+
export declare const supplierAggregatesQuerySchema: z.ZodObject<{
|
|
119
|
+
from: z.ZodOptional<z.ZodString>;
|
|
120
|
+
to: z.ZodOptional<z.ZodString>;
|
|
121
|
+
}, z.core.$strip>;
|
|
118
122
|
export type InsertSupplier = z.infer<typeof insertSupplierSchema>;
|
|
119
123
|
export type UpdateSupplier = z.infer<typeof updateSupplierSchema>;
|
|
120
124
|
export type SelectSupplier = z.infer<typeof selectSupplierSchema>;
|
package/dist/validation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AA+CvB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAqB,CAAA;AACtD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAA+B,CAAA;AAChE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAI/B,CAAA;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;iBAOlC,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AACjE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AACjE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAejE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;iBAAoB,CAAA;AACpD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;iBAA8B,CAAA;AAE9D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAC/D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAgB/D,eAAO,MAAM,gBAAgB;;;;;;;;;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iBAAoB,CAAA;AACpD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;iBAA8B,CAAA;AAE9D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAC/D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAgB/D,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;iBAAiB,CAAA;AAC9C,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;iBAA2B,CAAA;AAExD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AACzD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAIzD,eAAO,MAAM,wBAAwB;;iBAEnC,CAAA;AAIF,eAAO,MAAM,wBAAwB;;;;iBAInC,CAAA;AAEF,eAAO,MAAM,uBAAuB;;;iBAGlC,CAAA;AAeF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;iBAAqB,CAAA;AACtD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;iBAA+B,CAAA"}
|
package/dist/validation.js
CHANGED
|
@@ -54,6 +54,10 @@ export const supplierListQuerySchema = z.object({
|
|
|
54
54
|
limit: z.coerce.number().int().min(1).max(100).default(50),
|
|
55
55
|
offset: z.coerce.number().int().min(0).default(0),
|
|
56
56
|
});
|
|
57
|
+
export const supplierAggregatesQuerySchema = z.object({
|
|
58
|
+
from: z.string().datetime().optional(),
|
|
59
|
+
to: z.string().datetime().optional(),
|
|
60
|
+
});
|
|
57
61
|
// ---------- services ----------
|
|
58
62
|
const serviceCoreSchema = z.object({
|
|
59
63
|
serviceType: serviceTypeSchema,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/suppliers",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"license": "FSL-1.1-Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"drizzle-orm": "^0.45.2",
|
|
26
26
|
"hono": "^4.12.10",
|
|
27
27
|
"zod": "^4.3.6",
|
|
28
|
-
"@voyantjs/core": "0.
|
|
29
|
-
"@voyantjs/db": "0.
|
|
30
|
-
"@voyantjs/facilities": "0.
|
|
31
|
-
"@voyantjs/hono": "0.
|
|
32
|
-
"@voyantjs/identity": "0.
|
|
28
|
+
"@voyantjs/core": "0.7.0",
|
|
29
|
+
"@voyantjs/db": "0.7.0",
|
|
30
|
+
"@voyantjs/facilities": "0.7.0",
|
|
31
|
+
"@voyantjs/hono": "0.7.0",
|
|
32
|
+
"@voyantjs/identity": "0.7.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"typescript": "^6.0.2",
|