@voyant-travel/mice 0.3.0 → 0.4.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/index.d.ts CHANGED
@@ -9,11 +9,15 @@ export declare const programLinkable: LinkableDefinition;
9
9
  export declare const sessionLinkable: LinkableDefinition;
10
10
  export declare const delegateLinkable: LinkableDefinition;
11
11
  export declare const roomingAssignmentLinkable: LinkableDefinition;
12
+ export declare const rfpLinkable: LinkableDefinition;
13
+ export declare const bidLinkable: LinkableDefinition;
12
14
  export declare const miceLinkable: {
13
15
  program: LinkableDefinition;
14
16
  session: LinkableDefinition;
15
17
  delegate: LinkableDefinition;
16
18
  roomingAssignment: LinkableDefinition;
19
+ rfp: LinkableDefinition;
20
+ bid: LinkableDefinition;
17
21
  };
18
22
  export declare const miceModule: Module;
19
23
  export declare const miceHonoModule: HonoModule;
@@ -23,10 +27,12 @@ export { miceAdminRoutes } from "./routes.js";
23
27
  export * from "./schema.js";
24
28
  export * from "./service.js";
25
29
  export * from "./service-delegates.js";
30
+ export * from "./service-rfp.js";
26
31
  export * from "./service-rooming.js";
27
32
  export * from "./service-sessions.js";
28
33
  export * from "./validation.js";
29
34
  export * from "./validation-delegates.js";
35
+ export * from "./validation-rfp.js";
30
36
  export * from "./validation-rooming.js";
31
37
  export * from "./validation-sessions.js";
32
38
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAI5D;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,kBAK7B,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,kBAK7B,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,kBAK9B,CAAA;AAED,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,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,wBAAwB,CAAA;AACtC,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,2BAA2B,CAAA;AACzC,cAAc,qBAAqB,CAAA;AACnC,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA"}
package/dist/index.js CHANGED
@@ -28,11 +28,25 @@ export const roomingAssignmentLinkable = {
28
28
  table: "mice_rooming_assignments",
29
29
  idPrefix: "mrma",
30
30
  };
31
+ export const rfpLinkable = {
32
+ module: "mice",
33
+ entity: "rfp",
34
+ table: "mice_rfps",
35
+ idPrefix: "mrfp",
36
+ };
37
+ export const bidLinkable = {
38
+ module: "mice",
39
+ entity: "bid",
40
+ table: "mice_bids",
41
+ idPrefix: "mbid",
42
+ };
31
43
  export const miceLinkable = {
32
44
  program: programLinkable,
33
45
  session: sessionLinkable,
34
46
  delegate: delegateLinkable,
35
47
  roomingAssignment: roomingAssignmentLinkable,
48
+ rfp: rfpLinkable,
49
+ bid: bidLinkable,
36
50
  };
37
51
  export const miceModule = {
38
52
  name: "mice",
@@ -50,9 +64,11 @@ export { miceAdminRoutes } from "./routes.js";
50
64
  export * from "./schema.js";
51
65
  export * from "./service.js";
52
66
  export * from "./service-delegates.js";
67
+ export * from "./service-rfp.js";
53
68
  export * from "./service-rooming.js";
54
69
  export * from "./service-sessions.js";
55
70
  export * from "./validation.js";
56
71
  export * from "./validation-delegates.js";
72
+ export * from "./validation-rfp.js";
57
73
  export * from "./validation-rooming.js";
58
74
  export * from "./validation-sessions.js";
package/dist/routes.d.ts CHANGED
@@ -790,7 +790,465 @@ export declare const miceAdminRoutes: import("hono/hono-base").HonoBase<Env, {
790
790
  status: 409;
791
791
  };
792
792
  };
793
- }, "/", "/rooming-assignments/:id/delegates">;
793
+ } & {
794
+ "/rfps": {
795
+ $get: {
796
+ input: {};
797
+ output: {
798
+ data: {
799
+ status: "cancelled" | "draft" | "issued" | "closed" | "awarded";
800
+ id: string;
801
+ createdAt: string;
802
+ updatedAt: string;
803
+ notes: string | null;
804
+ programId: string;
805
+ title: string;
806
+ requirements: {
807
+ [x: string]: import("hono/utils/types").JSONValue;
808
+ } | null;
809
+ issuedAt: string | null;
810
+ dueAt: string | null;
811
+ }[];
812
+ limit: number;
813
+ offset: number;
814
+ };
815
+ outputFormat: "json";
816
+ status: import("hono/utils/http-status").ContentfulStatusCode;
817
+ };
818
+ };
819
+ } & {
820
+ "/rfps": {
821
+ $post: {
822
+ input: {};
823
+ output: {
824
+ error: string;
825
+ };
826
+ outputFormat: "json";
827
+ status: 404;
828
+ } | {
829
+ input: {};
830
+ output: {
831
+ data: {
832
+ status: "cancelled" | "draft" | "issued" | "closed" | "awarded";
833
+ id: string;
834
+ createdAt: string;
835
+ updatedAt: string;
836
+ notes: string | null;
837
+ programId: string;
838
+ title: string;
839
+ requirements: {
840
+ [x: string]: import("hono/utils/types").JSONValue;
841
+ } | null;
842
+ issuedAt: string | null;
843
+ dueAt: string | null;
844
+ };
845
+ };
846
+ outputFormat: "json";
847
+ status: 201;
848
+ };
849
+ };
850
+ } & {
851
+ "/rfps/:id": {
852
+ $get: {
853
+ input: {
854
+ param: {
855
+ id: string;
856
+ };
857
+ };
858
+ output: {
859
+ error: string;
860
+ };
861
+ outputFormat: "json";
862
+ status: 404;
863
+ } | {
864
+ input: {
865
+ param: {
866
+ id: string;
867
+ };
868
+ };
869
+ output: {
870
+ data: {
871
+ status: "cancelled" | "draft" | "issued" | "closed" | "awarded";
872
+ id: string;
873
+ createdAt: string;
874
+ updatedAt: string;
875
+ notes: string | null;
876
+ programId: string;
877
+ title: string;
878
+ requirements: {
879
+ [x: string]: import("hono/utils/types").JSONValue;
880
+ } | null;
881
+ issuedAt: string | null;
882
+ dueAt: string | null;
883
+ invitations: {
884
+ status: "invited" | "viewed" | "declined" | "responded";
885
+ id: string;
886
+ createdAt: string;
887
+ updatedAt: string;
888
+ rfpId: string;
889
+ supplierId: string;
890
+ }[];
891
+ bids: {
892
+ currency: string | null;
893
+ status: "draft" | "submitted" | "under_review" | "accepted" | "rejected";
894
+ id: string;
895
+ createdAt: string;
896
+ updatedAt: string;
897
+ notes: string | null;
898
+ rfpId: string;
899
+ supplierId: string;
900
+ totalCents: number | null;
901
+ proposalDoc: string | null;
902
+ validUntil: string | null;
903
+ }[];
904
+ };
905
+ };
906
+ outputFormat: "json";
907
+ status: import("hono/utils/http-status").ContentfulStatusCode;
908
+ };
909
+ };
910
+ } & {
911
+ "/rfps/:id": {
912
+ $patch: {
913
+ input: {
914
+ param: {
915
+ id: string;
916
+ };
917
+ };
918
+ output: {
919
+ error: string;
920
+ };
921
+ outputFormat: "json";
922
+ status: 404;
923
+ } | {
924
+ input: {
925
+ param: {
926
+ id: string;
927
+ };
928
+ };
929
+ output: {
930
+ data: {
931
+ status: "cancelled" | "draft" | "issued" | "closed" | "awarded";
932
+ id: string;
933
+ createdAt: string;
934
+ updatedAt: string;
935
+ notes: string | null;
936
+ programId: string;
937
+ title: string;
938
+ requirements: {
939
+ [x: string]: import("hono/utils/types").JSONValue;
940
+ } | null;
941
+ issuedAt: string | null;
942
+ dueAt: string | null;
943
+ };
944
+ };
945
+ outputFormat: "json";
946
+ status: import("hono/utils/http-status").ContentfulStatusCode;
947
+ };
948
+ };
949
+ } & {
950
+ "/rfps/:id/invitations": {
951
+ $post: {
952
+ input: {
953
+ param: {
954
+ id: string;
955
+ };
956
+ };
957
+ output: {
958
+ error: string;
959
+ };
960
+ outputFormat: "json";
961
+ status: 404;
962
+ } | {
963
+ input: {
964
+ param: {
965
+ id: string;
966
+ };
967
+ };
968
+ output: {
969
+ data: {
970
+ status: "invited" | "viewed" | "declined" | "responded";
971
+ id: string;
972
+ createdAt: string;
973
+ updatedAt: string;
974
+ rfpId: string;
975
+ supplierId: string;
976
+ };
977
+ };
978
+ outputFormat: "json";
979
+ status: 200 | 201;
980
+ };
981
+ };
982
+ } & {
983
+ "/rfps/:id/bids": {
984
+ $post: {
985
+ input: {
986
+ param: {
987
+ id: string;
988
+ };
989
+ };
990
+ output: {
991
+ error: string;
992
+ };
993
+ outputFormat: "json";
994
+ status: 404;
995
+ } | {
996
+ input: {
997
+ param: {
998
+ id: string;
999
+ };
1000
+ };
1001
+ output: {
1002
+ data: {
1003
+ currency: string | null;
1004
+ status: "draft" | "submitted" | "under_review" | "accepted" | "rejected";
1005
+ id: string;
1006
+ createdAt: string;
1007
+ updatedAt: string;
1008
+ notes: string | null;
1009
+ rfpId: string;
1010
+ supplierId: string;
1011
+ totalCents: number | null;
1012
+ proposalDoc: string | null;
1013
+ validUntil: string | null;
1014
+ };
1015
+ };
1016
+ outputFormat: "json";
1017
+ status: 201;
1018
+ };
1019
+ };
1020
+ } & {
1021
+ "/rfps/:id/award": {
1022
+ $post: {
1023
+ input: {
1024
+ param: {
1025
+ id: string;
1026
+ };
1027
+ };
1028
+ output: {
1029
+ data: {
1030
+ rfp: {
1031
+ status: "cancelled" | "draft" | "issued" | "closed" | "awarded";
1032
+ id: string;
1033
+ createdAt: string;
1034
+ updatedAt: string;
1035
+ notes: string | null;
1036
+ programId: string;
1037
+ title: string;
1038
+ requirements: {
1039
+ [x: string]: import("hono/utils/types").JSONValue;
1040
+ } | null;
1041
+ issuedAt: string | null;
1042
+ dueAt: string | null;
1043
+ };
1044
+ bid: {
1045
+ currency: string | null;
1046
+ status: "draft" | "submitted" | "under_review" | "accepted" | "rejected";
1047
+ id: string;
1048
+ createdAt: string;
1049
+ updatedAt: string;
1050
+ notes: string | null;
1051
+ rfpId: string;
1052
+ supplierId: string;
1053
+ totalCents: number | null;
1054
+ proposalDoc: string | null;
1055
+ validUntil: string | null;
1056
+ };
1057
+ };
1058
+ };
1059
+ outputFormat: "json";
1060
+ status: import("hono/utils/http-status").ContentfulStatusCode;
1061
+ } | {
1062
+ input: {
1063
+ param: {
1064
+ id: string;
1065
+ };
1066
+ };
1067
+ output: {
1068
+ error: string;
1069
+ };
1070
+ outputFormat: "json";
1071
+ status: 404;
1072
+ } | {
1073
+ input: {
1074
+ param: {
1075
+ id: string;
1076
+ };
1077
+ };
1078
+ output: {
1079
+ error: string;
1080
+ };
1081
+ outputFormat: "json";
1082
+ status: 409;
1083
+ };
1084
+ };
1085
+ } & {
1086
+ "/bids/:id": {
1087
+ $get: {
1088
+ input: {
1089
+ param: {
1090
+ id: string;
1091
+ };
1092
+ };
1093
+ output: {
1094
+ error: string;
1095
+ };
1096
+ outputFormat: "json";
1097
+ status: 404;
1098
+ } | {
1099
+ input: {
1100
+ param: {
1101
+ id: string;
1102
+ };
1103
+ };
1104
+ output: {
1105
+ data: {
1106
+ currency: string | null;
1107
+ status: "draft" | "submitted" | "under_review" | "accepted" | "rejected";
1108
+ id: string;
1109
+ createdAt: string;
1110
+ updatedAt: string;
1111
+ notes: string | null;
1112
+ rfpId: string;
1113
+ supplierId: string;
1114
+ totalCents: number | null;
1115
+ proposalDoc: string | null;
1116
+ validUntil: string | null;
1117
+ lines: {
1118
+ id: string;
1119
+ createdAt: string;
1120
+ description: string | null;
1121
+ quantity: number;
1122
+ totalCents: number | null;
1123
+ bidId: string;
1124
+ requirementRef: string | null;
1125
+ unitCents: number | null;
1126
+ }[];
1127
+ evaluations: {
1128
+ id: string;
1129
+ createdAt: string;
1130
+ notes: string | null;
1131
+ bidId: string;
1132
+ criterion: string;
1133
+ weight: number | null;
1134
+ score: number | null;
1135
+ evaluatedBy: string | null;
1136
+ }[];
1137
+ };
1138
+ };
1139
+ outputFormat: "json";
1140
+ status: import("hono/utils/http-status").ContentfulStatusCode;
1141
+ };
1142
+ };
1143
+ } & {
1144
+ "/bids/:id": {
1145
+ $patch: {
1146
+ input: {
1147
+ param: {
1148
+ id: string;
1149
+ };
1150
+ };
1151
+ output: {
1152
+ error: string;
1153
+ };
1154
+ outputFormat: "json";
1155
+ status: 404;
1156
+ } | {
1157
+ input: {
1158
+ param: {
1159
+ id: string;
1160
+ };
1161
+ };
1162
+ output: {
1163
+ data: {
1164
+ currency: string | null;
1165
+ status: "draft" | "submitted" | "under_review" | "accepted" | "rejected";
1166
+ id: string;
1167
+ createdAt: string;
1168
+ updatedAt: string;
1169
+ notes: string | null;
1170
+ rfpId: string;
1171
+ supplierId: string;
1172
+ totalCents: number | null;
1173
+ proposalDoc: string | null;
1174
+ validUntil: string | null;
1175
+ };
1176
+ };
1177
+ outputFormat: "json";
1178
+ status: import("hono/utils/http-status").ContentfulStatusCode;
1179
+ };
1180
+ };
1181
+ } & {
1182
+ "/bids/:id/lines": {
1183
+ $put: {
1184
+ input: {
1185
+ param: {
1186
+ id: string;
1187
+ };
1188
+ };
1189
+ output: {
1190
+ error: string;
1191
+ };
1192
+ outputFormat: "json";
1193
+ status: 404;
1194
+ } | {
1195
+ input: {
1196
+ param: {
1197
+ id: string;
1198
+ };
1199
+ };
1200
+ output: {
1201
+ data: {
1202
+ id: string;
1203
+ createdAt: string;
1204
+ description: string | null;
1205
+ quantity: number;
1206
+ totalCents: number | null;
1207
+ bidId: string;
1208
+ requirementRef: string | null;
1209
+ unitCents: number | null;
1210
+ }[];
1211
+ };
1212
+ outputFormat: "json";
1213
+ status: import("hono/utils/http-status").ContentfulStatusCode;
1214
+ };
1215
+ };
1216
+ } & {
1217
+ "/bids/:id/evaluations": {
1218
+ $post: {
1219
+ input: {
1220
+ param: {
1221
+ id: string;
1222
+ };
1223
+ };
1224
+ output: {
1225
+ error: string;
1226
+ };
1227
+ outputFormat: "json";
1228
+ status: 404;
1229
+ } | {
1230
+ input: {
1231
+ param: {
1232
+ id: string;
1233
+ };
1234
+ };
1235
+ output: {
1236
+ data: {
1237
+ id: string;
1238
+ createdAt: string;
1239
+ notes: string | null;
1240
+ bidId: string;
1241
+ criterion: string;
1242
+ weight: number | null;
1243
+ score: number | null;
1244
+ evaluatedBy: string | null;
1245
+ };
1246
+ };
1247
+ outputFormat: "json";
1248
+ status: 201;
1249
+ };
1250
+ };
1251
+ }, "/", "/bids/:id/evaluations">;
794
1252
  export type MiceAdminRoutes = typeof miceAdminRoutes;
795
1253
  export {};
796
1254
  //# sourceMappingURL=routes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AA8CjE,KAAK,GAAG,GAAG;IACT,SAAS,EAAE;QACT,EAAE,EAAE,kBAAkB,CAAA;QACtB,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;CACF,CAAA;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCA0MxB,CAAA;AAEJ,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAA"}
package/dist/routes.js CHANGED
@@ -6,10 +6,12 @@ import { parseJsonBody, parseQuery } from "@voyant-travel/hono";
6
6
  import { Hono } from "hono";
7
7
  import { createProgram, getProgram, listPrograms, updateProgram } from "./service.js";
8
8
  import { createDelegate, enrollDelegate, getDelegate, listDelegates, updateDelegate, } from "./service-delegates.js";
9
+ import { rfpService } from "./service-rfp.js";
9
10
  import { createRoomingAssignment, getRoomingAssignment, listRoomingAssignments, setRoomingDelegates, updateRoomingAssignment, } from "./service-rooming.js";
10
11
  import { createSession, deleteSession, getSession, listSessions, setSessionInclusions, updateSession, } from "./service-sessions.js";
11
12
  import { createProgramSchema, programListQuerySchema, updateProgramSchema } from "./validation.js";
12
13
  import { createDelegateSchema, delegateListQuerySchema, enrollDelegateSchema, updateDelegateSchema, } from "./validation-delegates.js";
14
+ import { addBidEvaluationSchema, awardRfpSchema, createBidSchema, createRfpSchema, inviteSupplierSchema, rfpListQuerySchema, setBidLinesSchema, updateBidSchema, updateRfpSchema, } from "./validation-rfp.js";
13
15
  import { createRoomingAssignmentSchema, roomingListQuerySchema, setRoomingDelegatesSchema, updateRoomingAssignmentSchema, } from "./validation-rooming.js";
14
16
  import { createSessionSchema, sessionListQuerySchema, setSessionInclusionsSchema, updateSessionSchema, } from "./validation-sessions.js";
15
17
  export const miceAdminRoutes = new Hono()
@@ -153,4 +155,84 @@ export const miceAdminRoutes = new Hono()
153
155
  detail: { offending: outcome.offending },
154
156
  }, 409);
155
157
  }
158
+ })
159
+ // Sourcing funnel: RFP → invitations → bids → evaluation → award (Phase 4).
160
+ .get("/rfps", async (c) => {
161
+ const query = await parseQuery(c, rfpListQuerySchema);
162
+ return c.json(await rfpService.listRfps(c.get("db"), query));
163
+ })
164
+ .post("/rfps", async (c) => {
165
+ const body = await parseJsonBody(c, createRfpSchema);
166
+ const outcome = await rfpService.createRfp(c.get("db"), body);
167
+ if (outcome.status === "program_not_found")
168
+ return c.json({ error: "Program not found" }, 404);
169
+ return c.json({ data: outcome.rfp }, 201);
170
+ })
171
+ .get("/rfps/:id", async (c) => {
172
+ const rfp = await rfpService.getRfp(c.get("db"), c.req.param("id"));
173
+ if (!rfp)
174
+ return c.json({ error: "RFP not found" }, 404);
175
+ return c.json({ data: rfp });
176
+ })
177
+ .patch("/rfps/:id", async (c) => {
178
+ const body = await parseJsonBody(c, updateRfpSchema);
179
+ const rfp = await rfpService.updateRfp(c.get("db"), c.req.param("id"), body);
180
+ if (!rfp)
181
+ return c.json({ error: "RFP not found" }, 404);
182
+ return c.json({ data: rfp });
183
+ })
184
+ .post("/rfps/:id/invitations", async (c) => {
185
+ const body = await parseJsonBody(c, inviteSupplierSchema);
186
+ const outcome = await rfpService.inviteSupplier(c.get("db"), c.req.param("id"), body);
187
+ if (outcome.status === "rfp_not_found")
188
+ return c.json({ error: "RFP not found" }, 404);
189
+ return c.json({ data: outcome.invitation }, outcome.idempotent ? 200 : 201);
190
+ })
191
+ .post("/rfps/:id/bids", async (c) => {
192
+ const body = await parseJsonBody(c, createBidSchema);
193
+ const outcome = await rfpService.createBid(c.get("db"), c.req.param("id"), body);
194
+ if (outcome.status === "rfp_not_found")
195
+ return c.json({ error: "RFP not found" }, 404);
196
+ return c.json({ data: outcome.bid }, 201);
197
+ })
198
+ .post("/rfps/:id/award", async (c) => {
199
+ const { bidId } = await parseJsonBody(c, awardRfpSchema);
200
+ const outcome = await rfpService.awardRfp(c.get("db"), c.req.param("id"), bidId);
201
+ switch (outcome.status) {
202
+ case "ok":
203
+ return c.json({ data: { rfp: outcome.rfp, bid: outcome.bid } });
204
+ case "rfp_not_found":
205
+ return c.json({ error: "RFP not found" }, 404);
206
+ case "bid_not_found":
207
+ return c.json({ error: "Bid not found on this RFP" }, 404);
208
+ case "already_awarded":
209
+ return c.json({ error: "RFP is already awarded" }, 409);
210
+ }
211
+ })
212
+ .get("/bids/:id", async (c) => {
213
+ const bid = await rfpService.getBid(c.get("db"), c.req.param("id"));
214
+ if (!bid)
215
+ return c.json({ error: "Bid not found" }, 404);
216
+ return c.json({ data: bid });
217
+ })
218
+ .patch("/bids/:id", async (c) => {
219
+ const body = await parseJsonBody(c, updateBidSchema);
220
+ const bid = await rfpService.updateBid(c.get("db"), c.req.param("id"), body);
221
+ if (!bid)
222
+ return c.json({ error: "Bid not found" }, 404);
223
+ return c.json({ data: bid });
224
+ })
225
+ .put("/bids/:id/lines", async (c) => {
226
+ const { lines } = await parseJsonBody(c, setBidLinesSchema);
227
+ const outcome = await rfpService.setBidLines(c.get("db"), c.req.param("id"), lines);
228
+ if (outcome.status === "bid_not_found")
229
+ return c.json({ error: "Bid not found" }, 404);
230
+ return c.json({ data: outcome.lines });
231
+ })
232
+ .post("/bids/:id/evaluations", async (c) => {
233
+ const body = await parseJsonBody(c, addBidEvaluationSchema);
234
+ const outcome = await rfpService.addBidEvaluation(c.get("db"), c.req.param("id"), body);
235
+ if (outcome.status === "bid_not_found")
236
+ return c.json({ error: "Bid not found" }, 404);
237
+ return c.json({ data: outcome.evaluation }, 201);
156
238
  });