procbay-schema 1.0.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.
Files changed (280) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +189 -0
  3. package/package.json +77 -0
  4. package/prisma/.env +13 -0
  5. package/prisma/migrations/20250116142512_init_user_table/migration.sql +38 -0
  6. package/prisma/migrations/20250116142709_init_role_table/migration.sql +20 -0
  7. package/prisma/migrations/20250116143847_init_user_role_table/migration.sql +20 -0
  8. package/prisma/migrations/20250116144035_init_permission_table/migration.sql +21 -0
  9. package/prisma/migrations/20250116144140_init_role_permission_table/migration.sql +21 -0
  10. package/prisma/migrations/20250116144233_init_department_table/migration.sql +20 -0
  11. package/prisma/migrations/20250116144345_init_user_department_table/migration.sql +20 -0
  12. package/prisma/migrations/20250116152941_init_serial_number_table/migration.sql +17 -0
  13. package/prisma/migrations/20250116153048_init_category_table/migration.sql +22 -0
  14. package/prisma/migrations/20250116153415_init_attributes_table/migration.sql +28 -0
  15. package/prisma/migrations/20250116153628_init_attribute_values_table/migration.sql +27 -0
  16. package/prisma/migrations/20250116153900_init_purchase_intake_table/migration.sql +32 -0
  17. package/prisma/migrations/20250116154038_init_purchase_intake_item_table/migration.sql +15 -0
  18. package/prisma/migrations/20250120090355_added_reset_token_column_in_user_table/migration.sql +10 -0
  19. package/prisma/migrations/20250120100616_init_item_table/migration.sql +42 -0
  20. package/prisma/migrations/20250120123720_init_vendor_table/migration.sql +39 -0
  21. package/prisma/migrations/20250120124526_init_vendor_categories_table/migration.sql +20 -0
  22. package/prisma/migrations/20250122114935_added_email_template_and_smtp_config_table/migration.sql +41 -0
  23. package/prisma/migrations/20250123095637_chnages_in_vendr_table/migration.sql +3 -0
  24. package/prisma/migrations/20250123103705_added_delated_filed_in_email_template_table/migration.sql +4 -0
  25. package/prisma/migrations/20250123103810_added_delated_filed_in_smtp_config_table/migration.sql +13 -0
  26. package/prisma/migrations/20250127123900_create_approval_heirarchy_table/migration.sql +72 -0
  27. package/prisma/migrations/20250128054523_make_optional_role_and_user_in_approval_hierachy/migration.sql +3 -0
  28. package/prisma/migrations/20250129084223_item_table_chnages/migration.sql +151 -0
  29. package/prisma/migrations/20250130115331_chnages_in_item_table/migration.sql +9 -0
  30. package/prisma/migrations/20250131054132_added_approval_journey_table/migration.sql +22 -0
  31. package/prisma/migrations/20250131064653_added_default_for_product_id_in_item_table/migration.sql +2 -0
  32. package/prisma/migrations/20250204101253_chnages_in_approval_table/migration.sql +39 -0
  33. package/prisma/migrations/20250206091422_added_item_document_table/migration.sql +17 -0
  34. package/prisma/migrations/20250207113110_added_new_column_media/migration.sql +9 -0
  35. package/prisma/migrations/20250207125224_added_chnages_in_pr_table/migration.sql +12 -0
  36. package/prisma/migrations/20250212092048_vendor_contact_table/migration.sql +30 -0
  37. package/prisma/migrations/20250212133620_added_tamplate_master_table/migration.sql +43 -0
  38. package/prisma/migrations/20250213111908_created_faq_catgory_and_faq_table/migration.sql +58 -0
  39. package/prisma/migrations/20250214065142_chnages_in_uom_table/migration.sql +50 -0
  40. package/prisma/migrations/20250217061122_corrected_email_teamplate_table/migration.sql +11 -0
  41. package/prisma/migrations/20250218073530_init_events/migration.sql +120 -0
  42. package/prisma/migrations/20250218092119_corrected_table_name/migration.sql +37 -0
  43. package/prisma/migrations/20250218120935_chnages_in_event_table/migration.sql +5 -0
  44. package/prisma/migrations/20250219083326_added_new_table_for_event_startegy/migration.sql +60 -0
  45. package/prisma/migrations/20250219083416_added_cms_table/migration.sql +29 -0
  46. package/prisma/migrations/20250219092918_alter_event_table/migration.sql +5 -0
  47. package/prisma/migrations/20250219093046_alter_event_to_draft/migration.sql +2 -0
  48. package/prisma/migrations/20250220080337_altered_event_table/migration.sql +9 -0
  49. package/prisma/migrations/20250221105922_added_unique_to_email_in_user_table/migration.sql +8 -0
  50. package/prisma/migrations/20250225063838_created_vendor_kyc_table/migration.sql +23 -0
  51. package/prisma/migrations/20250227060646_template_field_types_added_enum/migration.sql +14 -0
  52. package/prisma/migrations/20250227110306_updated_event_items_and_event_vendor_table/migration.sql +7 -0
  53. package/prisma/migrations/20250228060440_added_country_code_in_vendor_contact_person/migration.sql +2 -0
  54. package/prisma/migrations/20250228095319_init_currencies_table/migration.sql +23 -0
  55. package/prisma/migrations/20250303082614_added_support_ticket_table/migration.sql +89 -0
  56. package/prisma/migrations/20250304050248_alter_support_ticket_relations/migration.sql +35 -0
  57. package/prisma/migrations/20250304050613_alter_support_ticket_realtions/migration.sql +36 -0
  58. package/prisma/migrations/20250304061954_init_support_category_table/migration.sql +261 -0
  59. package/prisma/migrations/20250304092346_alter_event_vendor_table/migration.sql +2 -0
  60. package/prisma/migrations/20250305065430_alter_vendor_kyc_table/migration.sql +2 -0
  61. package/prisma/migrations/20250305111735_alter_vendor_and_user_table/migration.sql +5 -0
  62. package/prisma/migrations/20250307033751_alter_token_version_in_user_and_vendor_token/migration.sql +5 -0
  63. package/prisma/migrations/20250307034907_alter_user_and_vendor_table/migration.sql +14 -0
  64. package/prisma/migrations/20250307064359_chnages_in_approval_herarcy_table/migration.sql +2 -0
  65. package/prisma/migrations/20250307105352_alter_itme_and_vendorkyc_table/migration.sql +21 -0
  66. package/prisma/migrations/20250310103914_init_vendor_status_table/migration.sql +21 -0
  67. package/prisma/migrations/20250310105209_alter_vendor_status_table/migration.sql +18 -0
  68. package/prisma/migrations/20250310105413_init_vendor_kyc_status_table/migration.sql +23 -0
  69. package/prisma/migrations/20250311090552_alter_vendor_kyc_status_table/migration.sql +2 -0
  70. package/prisma/migrations/20250312055258_alter_status_column_in_event_vendors/migration.sql +12 -0
  71. package/prisma/migrations/20250312072145_init_vendor_event_watchlist_table/migration.sql +26 -0
  72. package/prisma/migrations/20250312083842_alter_vendor_event_watchlisst_table/migration.sql +41 -0
  73. package/prisma/migrations/20250312134730_added_chnages_in_kyc_table/migration.sql +19 -0
  74. package/prisma/migrations/20250317040841_init_admin_and_vendor_tables/migration.sql +38 -0
  75. package/prisma/migrations/20250317044110_alter_event_vendor_table/migration.sql +2 -0
  76. package/prisma/migrations/20250317071807_alter_rejected_reason_in_approval_journey_and_purchase_intak_table/migration.sql +5 -0
  77. package/prisma/migrations/20250318085504_init_customer_notification_table/migration.sql +31 -0
  78. package/prisma/migrations/20250318085856_alter_purchase_intake_table/migration.sql +18 -0
  79. package/prisma/migrations/20250319085159_alter_purchase_intake_table/migration.sql +12 -0
  80. package/prisma/migrations/20250320093356_init_bid_and_bidlog_table/migration.sql +75 -0
  81. package/prisma/migrations/20250320095501_alter_email_template_table/migration.sql +2 -0
  82. package/prisma/migrations/20250321053926_alter_approval_journey_table/migration.sql +2 -0
  83. package/prisma/migrations/20250324040851_alter_bidlog_table/migration.sql +2 -0
  84. package/prisma/migrations/20250324091328_init_form_master_and_dynamic_form_table/migration.sql +53 -0
  85. package/prisma/migrations/20250324103742_alter_bidlog_table/migration.sql +5 -0
  86. package/prisma/migrations/20250325052714_alter_form_master_table/migration.sql +27 -0
  87. package/prisma/migrations/20250327011625_init_module_and_tenant_configuration_table/migration.sql +39 -0
  88. package/prisma/migrations/20250403054008_alter_purchase_intake_table/migration.sql +5 -0
  89. package/prisma/migrations/20250404115613_init_approval_level_user/migration.sql +98 -0
  90. package/prisma/migrations/20250410060521_alter_approval_journey_enums/migration.sql +12 -0
  91. package/prisma/migrations/20250410110823_alter_purchase_intake/migration.sql +2 -0
  92. package/prisma/migrations/20250411062955_alter_template_field_table/migration.sql +2 -0
  93. package/prisma/migrations/20250414065640_alter_template/migration.sql +2 -0
  94. package/prisma/migrations/20250414111856_alter_event_vendors/migration.sql +2 -0
  95. package/prisma/migrations/20250414125356_alter_event_vendor/migration.sql +9 -0
  96. package/prisma/migrations/20250415063558_alter_alert_type_enum/migration.sql +2 -0
  97. package/prisma/migrations/20250416062508_alter_purchase_intake_table/migration.sql +15 -0
  98. package/prisma/migrations/20250417090325_alter_purchase_intake_table_updated_enum/migration.sql +13 -0
  99. package/prisma/migrations/20250417111024_alter_purchase_intake_and_purchase_intake_item/migration.sql +16 -0
  100. package/prisma/migrations/20250421061732_init_quotation_and_quotation_log_tables/migration.sql +96 -0
  101. package/prisma/migrations/20250421112331_alter_item_table_added_unique_to_slug/migration.sql +8 -0
  102. package/prisma/migrations/20250422060655_init_user_activity_table/migration.sql +17 -0
  103. package/prisma/migrations/20250423053027_/migration.sql +9 -0
  104. package/prisma/migrations/20250423103233_alter_user_login_activity_table/migration.sql +5 -0
  105. package/prisma/migrations/20250423111141_init_location_tables/migration.sql +141 -0
  106. package/prisma/migrations/20250424120106_alter_event_table_added_user_relation/migration.sql +2 -0
  107. package/prisma/migrations/20250424141637_alter_states_table/migration.sql +11 -0
  108. package/prisma/migrations/20250425105131_alter_user_login_activity_table/migration.sql +9 -0
  109. package/prisma/migrations/20250428092626_alter_location_tables/migration.sql +34 -0
  110. package/prisma/migrations/20250428114301_alter_location_table/migration.sql +14 -0
  111. package/prisma/migrations/20250429103436_alter_event_vendor_table/migration.sql +14 -0
  112. package/prisma/migrations/20250429135621_alter_event_vendor_table/migration.sql +5 -0
  113. package/prisma/migrations/20250430094809_alter_form_master_table_added_user_relation/migration.sql +2 -0
  114. package/prisma/migrations/20250430103440_alter_event_table/migration.sql +3 -0
  115. package/prisma/migrations/20250501125411_alter_strategies_table/migration.sql +2 -0
  116. package/prisma/migrations/20250502065554_init_location_table/migration.sql +41 -0
  117. package/prisma/migrations/20250505104038_alter_bid_quotation_and_dynamic_form/migration.sql +22 -0
  118. package/prisma/migrations/20250505105253_alter_quotation/migration.sql +5 -0
  119. package/prisma/migrations/20250505124851_alter_alert_enum/migration.sql +56 -0
  120. package/prisma/migrations/20250505133250_init_sub_module_table/migration.sql +17 -0
  121. package/prisma/migrations/20250506054325_alter_event_vendor_bid_status/migration.sql +14 -0
  122. package/prisma/migrations/20250506102135_init_counter_offer_table/migration.sql +38 -0
  123. package/prisma/migrations/20250506103355_alter_bid_and_quotaion_table/migration.sql +5 -0
  124. package/prisma/migrations/20250506110309_alter_tenant_configuration_table/migration.sql +3 -0
  125. package/prisma/migrations/20250506123527_alter_vendor_kyu_infor_verification_status/migration.sql +2 -0
  126. package/prisma/migrations/20250507055536_alter_dynamic_form_table/migration.sql +2 -0
  127. package/prisma/migrations/20250507070518_alter_bid_log_and_quotation_log/migration.sql +15 -0
  128. package/prisma/migrations/20250507130834_alter_bid_status/migration.sql +10 -0
  129. package/prisma/migrations/20250508065503_alter_purchase_intake_item_table/migration.sql +16 -0
  130. package/prisma/migrations/20250508130119_alter_purchase_intake_item/migration.sql +13 -0
  131. package/prisma/migrations/20250512082244_altered_template_table_to_add_currency_id/migration.sql +12 -0
  132. package/prisma/migrations/20250512100817_alter_approval_journey_table/migration.sql +3 -0
  133. package/prisma/migrations/20250513083700_alter_item_table/migration.sql +2 -0
  134. package/prisma/migrations/20250514100915_alter_event_table_added_template_realtion/migration.sql +2 -0
  135. package/prisma/migrations/20250514103503_alter_vendor_table_added_is_kyc_approved_column/migration.sql +2 -0
  136. package/prisma/migrations/20250520131556_init_purchase_order_table/migration.sql +52 -0
  137. package/prisma/migrations/20250521113946_alter_purchase_order_status_enum/migration.sql +16 -0
  138. package/prisma/migrations/20250522083917_alter_event_vendor_bid_status_enum/migration.sql +17 -0
  139. package/prisma/migrations/20250522131610_updated_vendor_table/migration.sql +16 -0
  140. package/prisma/migrations/20250523051058_alter_vendor_kyc_verificaiton_status_enum/migration.sql +2 -0
  141. package/prisma/migrations/20250526072120_alter_vendor_table/migration.sql +16 -0
  142. package/prisma/migrations/20250527055351_init_purchase_order_activity_log/migration.sql +41 -0
  143. package/prisma/migrations/20250528060657_alter_item_tale/migration.sql +14 -0
  144. package/prisma/migrations/20250528061946_alter_event_item_table/migration.sql +5 -0
  145. package/prisma/migrations/20250528081337_alter_item_table/migration.sql +2 -0
  146. package/prisma/migrations/20250528081524_removed_item_id_from_item_table/migration.sql +11 -0
  147. package/prisma/migrations/20250528081843_alter_item_table/migration.sql +2 -0
  148. package/prisma/migrations/20250528094057_alter_alert_type_enum/migration.sql +11 -0
  149. package/prisma/migrations/20250529053721_alter_added_quantity_in_purchase_order/migration.sql +2 -0
  150. package/prisma/migrations/20250602055114_alter_approval_journey_parent_id_to_string/migration.sql +2 -0
  151. package/prisma/migrations/20250602055748_alter_event_configuration_added_rule_slug/migration.sql +2 -0
  152. package/prisma/migrations/20250602111042_init_user_vendor_socket_token_table/migration.sql +17 -0
  153. package/prisma/migrations/20250602125833_alter_bidlog_and_quoatationlog_tableto_add_json_field/migration.sql +5 -0
  154. package/prisma/migrations/20250603063501_alter_bid_and_quoatation_table/migration.sql +29 -0
  155. package/prisma/migrations/20250606015045_alter_quotation_log_table/migration.sql +2 -0
  156. package/prisma/migrations/20250606020918_alter_quotation_table/migration.sql +2 -0
  157. package/prisma/migrations/20250606022901_alter_quotation_log_table/migration.sql +3 -0
  158. package/prisma/migrations/20250606054914_init_event_activity_logs_table/migration.sql +35 -0
  159. package/prisma/migrations/20250606100634_alter_added_counter_offer_status/migration.sql +5 -0
  160. package/prisma/migrations/20250606100908_alter_counter_offer_table/migration.sql +2 -0
  161. package/prisma/migrations/20250610055710_alter_enum/migration.sql +16 -0
  162. package/prisma/migrations/20250610060558_alter_event_and_event_vendor_db/migration.sql +14 -0
  163. package/prisma/migrations/20250610091013_alter_purchase_intak_item_table/migration.sql +4 -0
  164. package/prisma/migrations/20250610100156_alter_purchase_intake_item_table/migration.sql +19 -0
  165. package/prisma/migrations/20250610125706_alter_event_table/migration.sql +6 -0
  166. package/prisma/migrations/20250610133613_added_timestamp/migration.sql +319 -0
  167. package/prisma/migrations/20250611090439_init_contact_us_table/migration.sql +23 -0
  168. package/prisma/migrations/20250611121005_alter_event_vendor_table/migration.sql +10 -0
  169. package/prisma/migrations/20250612064335_alter_tenant_configuration/migration.sql +3 -0
  170. package/prisma/migrations/20250612094643_alter_event_vendor_bid_status_enum/migration.sql +2 -0
  171. package/prisma/migrations/20250618074558_alter_updated_bid_status_and_quotation_status/migration.sql +21 -0
  172. package/prisma/migrations/20250618122242_alter_added_event_phase_closed/migration.sql +2 -0
  173. package/prisma/migrations/20250620054518_alter_event_phase/migration.sql +2 -0
  174. package/prisma/migrations/20250620062723_alter_event_phase/migration.sql +2 -0
  175. package/prisma/migrations/20250620063056_alter_event_phase/migration.sql +2 -0
  176. package/prisma/migrations/20250620100507_alter_event_phase/migration.sql +2 -0
  177. package/prisma/migrations/20250627104958_alter_counter_offer_status/migration.sql +2 -0
  178. package/prisma/migrations/20250702095923_alter_item_table/migration.sql +74 -0
  179. package/prisma/migrations/20250702120134_/migration.sql +14 -0
  180. package/prisma/migrations/20250702150717_alter_attribute_table/migration.sql +9 -0
  181. package/prisma/migrations/20250703090321_alter_item_table/migration.sql +2 -0
  182. package/prisma/migrations/20250707054625_alter_purchase_order_table/migration.sql +15 -0
  183. package/prisma/migrations/20250707111354_alter_purchase_order_table_and_init_purchase_order_item_table/migration.sql +39 -0
  184. package/prisma/migrations/20250707111522_alter_purchase_order_item_table/migration.sql +17 -0
  185. package/prisma/migrations/20250710054113_alter_bid_and_quotation_status/migration.sql +31 -0
  186. package/prisma/migrations/20250710070813_alter_event_status/migration.sql +2 -0
  187. package/prisma/migrations/20250710082332_alter_bid_and_quotations_table/migration.sql +36 -0
  188. package/prisma/migrations/20250714102325_init_upload_log_table/migration.sql +27 -0
  189. package/prisma/migrations/20250716061012_alter_event_activity_logs_to_activity_logs/migration.sql +48 -0
  190. package/prisma/migrations/20250716071839_init_chat_thread_chat_message_and_ai_models/migration.sql +56 -0
  191. package/prisma/migrations/20250716135548_alter_admin_alerts_enum/migration.sql +2 -0
  192. package/prisma/migrations/20250717100515_init_user_event_configuration/migration.sql +21 -0
  193. package/prisma/migrations/20250717101037_alter_user_event_configuration_table/migration.sql +19 -0
  194. package/prisma/migrations/20250718071630_alter_added_module_in_upload_logs_table/migration.sql +5 -0
  195. package/prisma/migrations/20250718071732_alter_module_enum/migration.sql +15 -0
  196. package/prisma/migrations/20250721054851_init_export_log_table/migration.sql +34 -0
  197. package/prisma/migrations/20250722054549_init_fiscal_year_table/migration.sql +22 -0
  198. package/prisma/migrations/20250722072051_alter_fiscal_year_table_added_uuid/migration.sql +14 -0
  199. package/prisma/migrations/20250722095259_alter_fiscal_table/migration.sql +9 -0
  200. package/prisma/migrations/20250723071050_alter_department_table/migration.sql +14 -0
  201. package/prisma/migrations/20250724071201_alter_export_upload_log_enum/migration.sql +8 -0
  202. package/prisma/migrations/20250725094759_new_migrate/migration.sql +2 -0
  203. package/prisma/migrations/20250725095012_alter_migration/migration.sql +2 -0
  204. package/prisma/migrations/20250728072402_init_budget_management_tables/migration.sql +80 -0
  205. package/prisma/migrations/migration_lock.toml +3 -0
  206. package/prisma/schema.prisma +2609 -0
  207. package/prisma/seeders/approval-hierarchy.seed.js +340 -0
  208. package/prisma/seeders/attribute-value.seed.js +64 -0
  209. package/prisma/seeders/attribute.seed.js +61 -0
  210. package/prisma/seeders/category.seed.js +133 -0
  211. package/prisma/seeders/city.seed.js +147 -0
  212. package/prisma/seeders/country.seed.js +282 -0
  213. package/prisma/seeders/currency.seed.js +41 -0
  214. package/prisma/seeders/customer-notification.seed.js +83 -0
  215. package/prisma/seeders/department.seed.js +38 -0
  216. package/prisma/seeders/docs/CORE_SEEDER_OPTIMIZATIONS.md +270 -0
  217. package/prisma/seeders/docs/GEOGRAPHIC_PERFORMANCE_OPTIMIZATIONS.md +175 -0
  218. package/prisma/seeders/dynamic-form.seed.js +135 -0
  219. package/prisma/seeders/email-template.seed.js +68 -0
  220. package/prisma/seeders/faq-category.seed.js +56 -0
  221. package/prisma/seeders/faq.seed.js +61 -0
  222. package/prisma/seeders/form-master.seed.js +55 -0
  223. package/prisma/seeders/item.seed.js +133 -0
  224. package/prisma/seeders/permission.seed.js +102 -0
  225. package/prisma/seeders/region.seed.js +78 -0
  226. package/prisma/seeders/role-permission.seed.js +70 -0
  227. package/prisma/seeders/role.seed.js +38 -0
  228. package/prisma/seeders/seed.js +553 -0
  229. package/prisma/seeders/serial-number-config.seed.js +58 -0
  230. package/prisma/seeders/smtp-config.seed.js +61 -0
  231. package/prisma/seeders/state.seed.js +170 -0
  232. package/prisma/seeders/strategies.seed.js +54 -0
  233. package/prisma/seeders/subregion.seed.js +88 -0
  234. package/prisma/seeders/support-category.seed.js +56 -0
  235. package/prisma/seeders/template.seed.js +87 -0
  236. package/prisma/seeders/test-core-seeders.js +276 -0
  237. package/prisma/seeders/user-department.seed.js +66 -0
  238. package/prisma/seeders/user-event-configuration.seed.js +47 -0
  239. package/prisma/seeders/user-role.seed.js +74 -0
  240. package/prisma/seeders/user.seed.js +114 -0
  241. package/prisma/seeders/utils/bulk-seeder.js +300 -0
  242. package/prisma/seeders/utils/config.js +103 -0
  243. package/prisma/seeders/utils/connection-manager.js +380 -0
  244. package/prisma/seeders/utils/content-seeder.js +472 -0
  245. package/prisma/seeders/utils/core-seeder.js +330 -0
  246. package/prisma/seeders/utils/json-loader.js +69 -0
  247. package/prisma/seeders/utils/performance-config.js +341 -0
  248. package/prisma/seeders/utils/performance-helpers.js +206 -0
  249. package/prisma/seeders/utils/progress-tracker.js +364 -0
  250. package/prisma/seeders/utils/seeder-config-mapper.js +316 -0
  251. package/scripts/seed-databases.js +873 -0
  252. package/scripts/sync-schemas.js +865 -0
  253. package/scripts/truncate-tables.js +1048 -0
  254. package/src/prisma/client.d.ts +1 -0
  255. package/src/prisma/client.js +4 -0
  256. package/src/prisma/default.d.ts +1 -0
  257. package/src/prisma/default.js +4 -0
  258. package/src/prisma/edge.d.ts +1 -0
  259. package/src/prisma/edge.js +2084 -0
  260. package/src/prisma/index-browser.js +2043 -0
  261. package/src/prisma/index.d.ts +202051 -0
  262. package/src/prisma/index.js +2113 -0
  263. package/src/prisma/libquery_engine-darwin.dylib.node +0 -0
  264. package/src/prisma/libquery_engine-darwin.dylib.node.tmp24628 +0 -0
  265. package/src/prisma/libquery_engine-darwin.dylib.node.tmp29464 +0 -0
  266. package/src/prisma/libquery_engine-debian-openssl-3.0.x.so.node +0 -0
  267. package/src/prisma/package.json +140 -0
  268. package/src/prisma/query_engine-windows.dll.node +0 -0
  269. package/src/prisma/query_engine-windows.dll.node.tmp4144 +0 -0
  270. package/src/prisma/runtime/edge-esm.js +34 -0
  271. package/src/prisma/runtime/edge.js +34 -0
  272. package/src/prisma/runtime/index-browser.d.ts +370 -0
  273. package/src/prisma/runtime/index-browser.js +16 -0
  274. package/src/prisma/runtime/library.d.ts +3647 -0
  275. package/src/prisma/runtime/library.js +146 -0
  276. package/src/prisma/runtime/react-native.js +83 -0
  277. package/src/prisma/runtime/wasm.js +35 -0
  278. package/src/prisma/schema.prisma +2609 -0
  279. package/src/prisma/wasm.d.ts +1 -0
  280. package/src/prisma/wasm.js +2043 -0
@@ -0,0 +1,141 @@
1
+ -- CreateTable
2
+ CREATE TABLE "regions" (
3
+ "id" SERIAL NOT NULL,
4
+ "name" TEXT,
5
+ "translations" JSONB,
6
+ "wikiDataId" TEXT,
7
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
8
+ "updated_at" TIMESTAMP(3) NOT NULL,
9
+
10
+ CONSTRAINT "regions_pkey" PRIMARY KEY ("id")
11
+ );
12
+
13
+ -- CreateTable
14
+ CREATE TABLE "subregions" (
15
+ "id" SERIAL NOT NULL,
16
+ "name" TEXT,
17
+ "translations" JSONB,
18
+ "wikiDataId" TEXT,
19
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
20
+ "updated_at" TIMESTAMP(3) NOT NULL,
21
+ "region_id" INTEGER,
22
+
23
+ CONSTRAINT "subregions_pkey" PRIMARY KEY ("id")
24
+ );
25
+
26
+ -- CreateTable
27
+ CREATE TABLE "countries" (
28
+ "id" SERIAL NOT NULL,
29
+ "name" TEXT,
30
+ "iso3" CHAR(3),
31
+ "iso2" CHAR(2),
32
+ "numeric_code" CHAR(3),
33
+ "phonecode" TEXT,
34
+ "capital" TEXT,
35
+ "currency" TEXT,
36
+ "currency_name" TEXT,
37
+ "currency_symbol" TEXT,
38
+ "tld" TEXT,
39
+ "native" TEXT,
40
+ "region" TEXT,
41
+ "subregion" TEXT,
42
+ "nationality" TEXT,
43
+ "latitude" DECIMAL(10,8),
44
+ "longitude" DECIMAL(11,8),
45
+ "emoji" TEXT,
46
+ "emojiU" TEXT,
47
+ "timezones" JSONB,
48
+ "translations" JSONB,
49
+ "wikiDataId" TEXT,
50
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
51
+ "updated_at" TIMESTAMP(3) NOT NULL,
52
+ "region_id" INTEGER,
53
+ "subregion_id" INTEGER,
54
+
55
+ CONSTRAINT "countries_pkey" PRIMARY KEY ("id")
56
+ );
57
+
58
+ -- CreateTable
59
+ CREATE TABLE "states" (
60
+ "id" SERIAL NOT NULL,
61
+ "name" TEXT,
62
+ "state_code" TEXT,
63
+ "type" TEXT,
64
+ "latitude" DECIMAL(10,8),
65
+ "longitude" DECIMAL(11,8),
66
+ "wikiDataId" TEXT,
67
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
68
+ "updated_at" TIMESTAMP(3) NOT NULL,
69
+ "country_id" INTEGER,
70
+
71
+ CONSTRAINT "states_pkey" PRIMARY KEY ("id")
72
+ );
73
+
74
+ -- CreateTable
75
+ CREATE TABLE "cities" (
76
+ "id" SERIAL NOT NULL,
77
+ "name" TEXT,
78
+ "latitude" DECIMAL(10,8),
79
+ "longitude" DECIMAL(11,8),
80
+ "wikiDataId" TEXT,
81
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
82
+ "updated_at" TIMESTAMP(3) NOT NULL,
83
+ "state_id" INTEGER,
84
+ "country_id" INTEGER,
85
+
86
+ CONSTRAINT "cities_pkey" PRIMARY KEY ("id")
87
+ );
88
+
89
+ -- CreateIndex
90
+ CREATE UNIQUE INDEX "regions_name_key" ON "regions"("name");
91
+
92
+ -- CreateIndex
93
+ CREATE UNIQUE INDEX "subregions_name_key" ON "subregions"("name");
94
+
95
+ -- CreateIndex
96
+ CREATE INDEX "subregions_region_id_idx" ON "subregions"("region_id");
97
+
98
+ -- CreateIndex
99
+ CREATE UNIQUE INDEX "countries_iso3_key" ON "countries"("iso3");
100
+
101
+ -- CreateIndex
102
+ CREATE UNIQUE INDEX "countries_iso2_key" ON "countries"("iso2");
103
+
104
+ -- CreateIndex
105
+ CREATE INDEX "countries_region_id_idx" ON "countries"("region_id");
106
+
107
+ -- CreateIndex
108
+ CREATE INDEX "countries_subregion_id_idx" ON "countries"("subregion_id");
109
+
110
+ -- CreateIndex
111
+ CREATE INDEX "states_country_id_idx" ON "states"("country_id");
112
+
113
+ -- CreateIndex
114
+ CREATE UNIQUE INDEX "states_name_country_id_key" ON "states"("name", "country_id");
115
+
116
+ -- CreateIndex
117
+ CREATE INDEX "cities_state_id_idx" ON "cities"("state_id");
118
+
119
+ -- CreateIndex
120
+ CREATE INDEX "cities_country_id_idx" ON "cities"("country_id");
121
+
122
+ -- CreateIndex
123
+ CREATE UNIQUE INDEX "cities_name_country_id_state_id_key" ON "cities"("name", "country_id", "state_id");
124
+
125
+ -- AddForeignKey
126
+ ALTER TABLE "subregions" ADD CONSTRAINT "subregions_region_id_fkey" FOREIGN KEY ("region_id") REFERENCES "regions"("id") ON DELETE SET NULL ON UPDATE CASCADE;
127
+
128
+ -- AddForeignKey
129
+ ALTER TABLE "countries" ADD CONSTRAINT "countries_region_id_fkey" FOREIGN KEY ("region_id") REFERENCES "regions"("id") ON DELETE SET NULL ON UPDATE CASCADE;
130
+
131
+ -- AddForeignKey
132
+ ALTER TABLE "countries" ADD CONSTRAINT "countries_subregion_id_fkey" FOREIGN KEY ("subregion_id") REFERENCES "subregions"("id") ON DELETE SET NULL ON UPDATE CASCADE;
133
+
134
+ -- AddForeignKey
135
+ ALTER TABLE "states" ADD CONSTRAINT "states_country_id_fkey" FOREIGN KEY ("country_id") REFERENCES "countries"("id") ON DELETE SET NULL ON UPDATE CASCADE;
136
+
137
+ -- AddForeignKey
138
+ ALTER TABLE "cities" ADD CONSTRAINT "cities_state_id_fkey" FOREIGN KEY ("state_id") REFERENCES "states"("id") ON DELETE SET NULL ON UPDATE CASCADE;
139
+
140
+ -- AddForeignKey
141
+ ALTER TABLE "cities" ADD CONSTRAINT "cities_country_id_fkey" FOREIGN KEY ("country_id") REFERENCES "countries"("id") ON DELETE SET NULL ON UPDATE CASCADE;
@@ -0,0 +1,2 @@
1
+ -- AddForeignKey
2
+ ALTER TABLE "events" ADD CONSTRAINT "events_created_by_fkey" FOREIGN KEY ("created_by") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,11 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - A unique constraint covering the columns `[name,country_id,state_code]` on the table `states` will be added. If there are existing duplicate values, this will fail.
5
+
6
+ */
7
+ -- DropIndex
8
+ DROP INDEX "states_name_country_id_key";
9
+
10
+ -- CreateIndex
11
+ CREATE UNIQUE INDEX "states_name_country_id_state_code_key" ON "states"("name", "country_id", "state_code");
@@ -0,0 +1,9 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - The `user_id` column on the `user_login_activities` table would be dropped and recreated. This will lead to data loss if there is data in the column.
5
+
6
+ */
7
+ -- AlterTable
8
+ ALTER TABLE "user_login_activities" DROP COLUMN "user_id",
9
+ ADD COLUMN "user_id" INTEGER;
@@ -0,0 +1,34 @@
1
+ -- AlterTable
2
+ ALTER TABLE "cities" ADD COLUMN "created_by" INTEGER,
3
+ ADD COLUMN "deleted_by" INTEGER,
4
+ ADD COLUMN "is_deleted" BOOLEAN DEFAULT false,
5
+ ADD COLUMN "status" BOOLEAN DEFAULT false,
6
+ ADD COLUMN "updated_by" INTEGER;
7
+
8
+ -- AlterTable
9
+ ALTER TABLE "countries" ADD COLUMN "created_by" INTEGER,
10
+ ADD COLUMN "deleted_by" INTEGER,
11
+ ADD COLUMN "is_deleted" BOOLEAN DEFAULT false,
12
+ ADD COLUMN "status" BOOLEAN DEFAULT false,
13
+ ADD COLUMN "updated_by" INTEGER;
14
+
15
+ -- AlterTable
16
+ ALTER TABLE "regions" ADD COLUMN "created_by" INTEGER,
17
+ ADD COLUMN "deleted_by" INTEGER,
18
+ ADD COLUMN "is_deleted" BOOLEAN DEFAULT false,
19
+ ADD COLUMN "status" BOOLEAN DEFAULT false,
20
+ ADD COLUMN "updated_by" INTEGER;
21
+
22
+ -- AlterTable
23
+ ALTER TABLE "states" ADD COLUMN "created_by" INTEGER,
24
+ ADD COLUMN "deleted_by" INTEGER,
25
+ ADD COLUMN "is_deleted" BOOLEAN DEFAULT false,
26
+ ADD COLUMN "status" BOOLEAN DEFAULT false,
27
+ ADD COLUMN "updated_by" INTEGER;
28
+
29
+ -- AlterTable
30
+ ALTER TABLE "subregions" ADD COLUMN "created_by" INTEGER,
31
+ ADD COLUMN "deleted_by" INTEGER,
32
+ ADD COLUMN "is_deleted" BOOLEAN DEFAULT false,
33
+ ADD COLUMN "status" BOOLEAN DEFAULT false,
34
+ ADD COLUMN "updated_by" INTEGER;
@@ -0,0 +1,14 @@
1
+ -- AlterTable
2
+ ALTER TABLE "cities" ADD COLUMN "deleted_at" TIMESTAMP(3);
3
+
4
+ -- AlterTable
5
+ ALTER TABLE "countries" ADD COLUMN "deleted_at" TIMESTAMP(3);
6
+
7
+ -- AlterTable
8
+ ALTER TABLE "regions" ADD COLUMN "deleted_at" TIMESTAMP(3);
9
+
10
+ -- AlterTable
11
+ ALTER TABLE "states" ADD COLUMN "deleted_at" TIMESTAMP(3);
12
+
13
+ -- AlterTable
14
+ ALTER TABLE "subregions" ADD COLUMN "deleted_at" TIMESTAMP(3);
@@ -0,0 +1,14 @@
1
+ -- CreateEnum
2
+ CREATE TYPE "EventPhase" AS ENUM ('Invitation', 'PreBid', 'LiveBidding', 'BidEvaluation', 'ClosingSoon');
3
+
4
+ -- AlterTable
5
+ ALTER TABLE "event_vendors" ADD COLUMN "event_phase" "EventPhase" DEFAULT 'Invitation';
6
+
7
+ -- CreateIndex
8
+ CREATE INDEX "event_vendors_event_id_vendor_id_idx" ON "event_vendors"("event_id", "vendor_id");
9
+
10
+ -- CreateIndex
11
+ CREATE INDEX "event_vendors_status_idx" ON "event_vendors"("status");
12
+
13
+ -- CreateIndex
14
+ CREATE INDEX "event_vendors_event_phase_idx" ON "event_vendors"("event_phase");
@@ -0,0 +1,5 @@
1
+ -- CreateEnum
2
+ CREATE TYPE "EventVendorBidStatus" AS ENUM ('BidSeen', 'IntentToParticipate', 'DeclinedParticipation', 'Draft', 'BidSubmitted');
3
+
4
+ -- AlterTable
5
+ ALTER TABLE "event_vendors" ADD COLUMN "event_vendor_bid_status" "EventVendorBidStatus";
@@ -0,0 +1,2 @@
1
+ -- AddForeignKey
2
+ ALTER TABLE "form_masters" ADD CONSTRAINT "form_masters_created_by_fkey" FOREIGN KEY ("created_by") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,3 @@
1
+ -- AlterTable
2
+ ALTER TABLE "events" ADD COLUMN "is_published" BOOLEAN NOT NULL DEFAULT false,
3
+ ADD COLUMN "reason" TEXT;
@@ -0,0 +1,2 @@
1
+ -- AlterTable
2
+ ALTER TABLE "strategies" ADD COLUMN "description" TEXT;
@@ -0,0 +1,41 @@
1
+ -- CreateTable
2
+ CREATE TABLE "locations" (
3
+ "id" SERIAL NOT NULL,
4
+ "name" TEXT,
5
+ "address" TEXT,
6
+ "zipcode" TEXT,
7
+ "status" BOOLEAN DEFAULT false,
8
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
9
+ "created_by" INTEGER,
10
+ "updated_at" TIMESTAMP(3) NOT NULL,
11
+ "updated_by" INTEGER,
12
+ "is_deleted" BOOLEAN DEFAULT false,
13
+ "deleted_by" INTEGER,
14
+ "deleted_at" TIMESTAMP(3),
15
+ "country_id" INTEGER,
16
+ "state_id" INTEGER,
17
+ "city_id" INTEGER,
18
+
19
+ CONSTRAINT "locations_pkey" PRIMARY KEY ("id")
20
+ );
21
+
22
+ -- CreateIndex
23
+ CREATE INDEX "locations_country_id_idx" ON "locations"("country_id");
24
+
25
+ -- CreateIndex
26
+ CREATE INDEX "locations_state_id_idx" ON "locations"("state_id");
27
+
28
+ -- CreateIndex
29
+ CREATE INDEX "locations_city_id_idx" ON "locations"("city_id");
30
+
31
+ -- CreateIndex
32
+ CREATE UNIQUE INDEX "locations_name_country_id_state_id_city_id_key" ON "locations"("name", "country_id", "state_id", "city_id");
33
+
34
+ -- AddForeignKey
35
+ ALTER TABLE "locations" ADD CONSTRAINT "locations_country_id_fkey" FOREIGN KEY ("country_id") REFERENCES "countries"("id") ON DELETE SET NULL ON UPDATE CASCADE;
36
+
37
+ -- AddForeignKey
38
+ ALTER TABLE "locations" ADD CONSTRAINT "locations_state_id_fkey" FOREIGN KEY ("state_id") REFERENCES "states"("id") ON DELETE SET NULL ON UPDATE CASCADE;
39
+
40
+ -- AddForeignKey
41
+ ALTER TABLE "locations" ADD CONSTRAINT "locations_city_id_fkey" FOREIGN KEY ("city_id") REFERENCES "cities"("id") ON DELETE SET NULL ON UPDATE CASCADE;
@@ -0,0 +1,22 @@
1
+ -- AlterEnum
2
+ -- This migration adds more than one value to an enum.
3
+ -- With PostgreSQL versions 11 and earlier, this is not possible
4
+ -- in a single migration. This can be worked around by creating
5
+ -- multiple migrations, each migration adding only one value to
6
+ -- the enum.
7
+
8
+
9
+ ALTER TYPE "BidStatus" ADD VALUE 'COUNTER_OFFER';
10
+ ALTER TYPE "BidStatus" ADD VALUE 'REVISED';
11
+
12
+ -- AlterTable
13
+ ALTER TABLE "bid_logs" ADD COLUMN "counter_offer_by" INTEGER,
14
+ ADD COLUMN "in_response_to" INTEGER,
15
+ ADD COLUMN "is_counter_offer" BOOLEAN NOT NULL DEFAULT false,
16
+ ADD COLUMN "revision_number" INTEGER NOT NULL DEFAULT 1;
17
+
18
+ -- AlterTable
19
+ ALTER TABLE "bids" ADD COLUMN "current_revision" INTEGER NOT NULL DEFAULT 1;
20
+
21
+ -- AddForeignKey
22
+ ALTER TABLE "dynamic_forms" ADD CONSTRAINT "dynamic_forms_created_by_fkey" FOREIGN KEY ("created_by") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,5 @@
1
+ -- AlterEnum
2
+ ALTER TYPE "QuotationStatus" ADD VALUE 'COUNTER_OFFER';
3
+
4
+ -- DropForeignKey
5
+ ALTER TABLE "dynamic_forms" DROP CONSTRAINT "dynamic_forms_created_by_fkey";
@@ -0,0 +1,56 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - The values [RFQ] on the enum `AlertTypeEnum` will be removed. If these variants are still used in the database, this will fail.
5
+ - The values [COUNTER_OFFER,REVISED] on the enum `BidStatus` will be removed. If these variants are still used in the database, this will fail.
6
+ - The values [COUNTER_OFFER] on the enum `QuotationStatus` will be removed. If these variants are still used in the database, this will fail.
7
+ - You are about to drop the column `counter_offer_by` on the `bid_logs` table. All the data in the column will be lost.
8
+ - You are about to drop the column `in_response_to` on the `bid_logs` table. All the data in the column will be lost.
9
+ - You are about to drop the column `is_counter_offer` on the `bid_logs` table. All the data in the column will be lost.
10
+ - You are about to drop the column `revision_number` on the `bid_logs` table. All the data in the column will be lost.
11
+ - You are about to drop the column `current_revision` on the `bids` table. All the data in the column will be lost.
12
+
13
+ */
14
+ -- AlterEnum
15
+ BEGIN;
16
+ CREATE TYPE "AlertTypeEnum_new" AS ENUM ('PURCHASE_INTAKE', 'PURCHASE_REQUEST', 'PURCHASE_ORDER', 'APPROVAL', 'QUOTATION', 'AUCTION', 'VENDOR_KYC', 'GENERAL');
17
+ ALTER TABLE "admin_alerts" ALTER COLUMN "alert_type" TYPE "AlertTypeEnum_new" USING ("alert_type"::text::"AlertTypeEnum_new");
18
+ ALTER TABLE "vendor_alerts" ALTER COLUMN "alert_type" TYPE "AlertTypeEnum_new" USING ("alert_type"::text::"AlertTypeEnum_new");
19
+ ALTER TYPE "AlertTypeEnum" RENAME TO "AlertTypeEnum_old";
20
+ ALTER TYPE "AlertTypeEnum_new" RENAME TO "AlertTypeEnum";
21
+ DROP TYPE "AlertTypeEnum_old";
22
+ COMMIT;
23
+
24
+ -- AlterEnum
25
+ BEGIN;
26
+ CREATE TYPE "BidStatus_new" AS ENUM ('NOT_HIGHEST_BIDDER', 'HIGHEST_BIDDER', 'CANCELLED');
27
+ ALTER TABLE "bid_logs" ALTER COLUMN "bid_status" DROP DEFAULT;
28
+ ALTER TABLE "bid_logs" ALTER COLUMN "bid_status" TYPE "BidStatus_new" USING ("bid_status"::text::"BidStatus_new");
29
+ ALTER TYPE "BidStatus" RENAME TO "BidStatus_old";
30
+ ALTER TYPE "BidStatus_new" RENAME TO "BidStatus";
31
+ DROP TYPE "BidStatus_old";
32
+ ALTER TABLE "bid_logs" ALTER COLUMN "bid_status" SET DEFAULT 'NOT_HIGHEST_BIDDER';
33
+ COMMIT;
34
+
35
+ -- AlterEnum
36
+ BEGIN;
37
+ CREATE TYPE "QuotationStatus_new" AS ENUM ('SUBMITTED', 'UNDER_REVIEW', 'ACCEPTED', 'REJECTED', 'REVISED');
38
+ ALTER TABLE "quotation_logs" ALTER COLUMN "quotation_status" DROP DEFAULT;
39
+ ALTER TABLE "quotations" ALTER COLUMN "quotation_status" DROP DEFAULT;
40
+ ALTER TABLE "quotations" ALTER COLUMN "quotation_status" TYPE "QuotationStatus_new" USING ("quotation_status"::text::"QuotationStatus_new");
41
+ ALTER TABLE "quotation_logs" ALTER COLUMN "quotation_status" TYPE "QuotationStatus_new" USING ("quotation_status"::text::"QuotationStatus_new");
42
+ ALTER TYPE "QuotationStatus" RENAME TO "QuotationStatus_old";
43
+ ALTER TYPE "QuotationStatus_new" RENAME TO "QuotationStatus";
44
+ DROP TYPE "QuotationStatus_old";
45
+ ALTER TABLE "quotation_logs" ALTER COLUMN "quotation_status" SET DEFAULT 'SUBMITTED';
46
+ ALTER TABLE "quotations" ALTER COLUMN "quotation_status" SET DEFAULT 'SUBMITTED';
47
+ COMMIT;
48
+
49
+ -- AlterTable
50
+ ALTER TABLE "bid_logs" DROP COLUMN "counter_offer_by",
51
+ DROP COLUMN "in_response_to",
52
+ DROP COLUMN "is_counter_offer",
53
+ DROP COLUMN "revision_number";
54
+
55
+ -- AlterTable
56
+ ALTER TABLE "bids" DROP COLUMN "current_revision";
@@ -0,0 +1,17 @@
1
+ -- CreateTable
2
+ CREATE TABLE "sub_modules" (
3
+ "id" SERIAL NOT NULL,
4
+ "name" TEXT NOT NULL,
5
+ "slug" TEXT NOT NULL,
6
+ "module_id" INTEGER,
7
+ "created_by" INTEGER,
8
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
9
+
10
+ CONSTRAINT "sub_modules_pkey" PRIMARY KEY ("id")
11
+ );
12
+
13
+ -- CreateIndex
14
+ CREATE UNIQUE INDEX "sub_modules_slug_key" ON "sub_modules"("slug");
15
+
16
+ -- AddForeignKey
17
+ ALTER TABLE "sub_modules" ADD CONSTRAINT "sub_modules_module_id_fkey" FOREIGN KEY ("module_id") REFERENCES "modules"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,14 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - The values [BidSeen] on the enum `EventVendorBidStatus` will be removed. If these variants are still used in the database, this will fail.
5
+
6
+ */
7
+ -- AlterEnum
8
+ BEGIN;
9
+ CREATE TYPE "EventVendorBidStatus_new" AS ENUM ('Seen', 'IntentToParticipate', 'DeclinedParticipation', 'Draft', 'BidSubmitted');
10
+ ALTER TABLE "event_vendors" ALTER COLUMN "event_vendor_bid_status" TYPE "EventVendorBidStatus_new" USING ("event_vendor_bid_status"::text::"EventVendorBidStatus_new");
11
+ ALTER TYPE "EventVendorBidStatus" RENAME TO "EventVendorBidStatus_old";
12
+ ALTER TYPE "EventVendorBidStatus_new" RENAME TO "EventVendorBidStatus";
13
+ DROP TYPE "EventVendorBidStatus_old";
14
+ COMMIT;
@@ -0,0 +1,38 @@
1
+ -- CreateTable
2
+ CREATE TABLE "counter_offers" (
3
+ "id" SERIAL NOT NULL,
4
+ "uuid" TEXT NOT NULL,
5
+ "bid_id" INTEGER,
6
+ "quotation_id" INTEGER,
7
+ "counter_amount" DOUBLE PRECISION NOT NULL,
8
+ "counter_message" TEXT,
9
+ "technical_details" JSONB,
10
+ "delivery_timeline" TEXT,
11
+ "payment_terms" TEXT,
12
+ "warranty_terms" TEXT,
13
+ "is_viewed" BOOLEAN NOT NULL DEFAULT false,
14
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
15
+ "created_by" INTEGER NOT NULL,
16
+ "updated_at" TIMESTAMP(3) NOT NULL,
17
+ "updated_by" INTEGER,
18
+ "is_deleted" BOOLEAN NOT NULL DEFAULT false,
19
+ "deleted_at" TIMESTAMP(3),
20
+ "deleted_by" INTEGER,
21
+
22
+ CONSTRAINT "counter_offers_pkey" PRIMARY KEY ("id")
23
+ );
24
+
25
+ -- CreateIndex
26
+ CREATE UNIQUE INDEX "counter_offers_uuid_key" ON "counter_offers"("uuid");
27
+
28
+ -- CreateIndex
29
+ CREATE INDEX "counter_offers_bid_id_idx" ON "counter_offers"("bid_id");
30
+
31
+ -- CreateIndex
32
+ CREATE INDEX "counter_offers_quotation_id_idx" ON "counter_offers"("quotation_id");
33
+
34
+ -- AddForeignKey
35
+ ALTER TABLE "counter_offers" ADD CONSTRAINT "counter_offers_bid_id_fkey" FOREIGN KEY ("bid_id") REFERENCES "bids"("id") ON DELETE CASCADE ON UPDATE CASCADE;
36
+
37
+ -- AddForeignKey
38
+ ALTER TABLE "counter_offers" ADD CONSTRAINT "counter_offers_quotation_id_fkey" FOREIGN KEY ("quotation_id") REFERENCES "quotations"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,5 @@
1
+ -- AlterTable
2
+ ALTER TABLE "bids" ADD COLUMN "has_active_counter" BOOLEAN NOT NULL DEFAULT false;
3
+
4
+ -- AlterTable
5
+ ALTER TABLE "quotations" ADD COLUMN "has_active_counter" BOOLEAN NOT NULL DEFAULT false;
@@ -0,0 +1,3 @@
1
+ -- AlterTable
2
+ ALTER TABLE "tenant_configurations" ADD COLUMN "currency" TEXT,
3
+ ADD COLUMN "timezone" TEXT;
@@ -0,0 +1,2 @@
1
+ -- AlterTable
2
+ ALTER TABLE "vendor_kyc_info_verification_status" ADD COLUMN "updated_at" TIMESTAMP(3) DEFAULT CURRENT_TIMESTAMP;
@@ -0,0 +1,2 @@
1
+ -- AddForeignKey
2
+ ALTER TABLE "dynamic_forms" ADD CONSTRAINT "dynamic_forms_created_by_fkey" FOREIGN KEY ("created_by") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,15 @@
1
+ -- AlterTable
2
+ ALTER TABLE "bid_logs" ADD COLUMN "has_active_counter" BOOLEAN NOT NULL DEFAULT false;
3
+
4
+ -- AlterTable
5
+ ALTER TABLE "counter_offers" ADD COLUMN "bid_log_id" INTEGER,
6
+ ADD COLUMN "quotation_log_id" INTEGER;
7
+
8
+ -- AlterTable
9
+ ALTER TABLE "quotation_logs" ADD COLUMN "has_active_counter" BOOLEAN NOT NULL DEFAULT false;
10
+
11
+ -- AddForeignKey
12
+ ALTER TABLE "counter_offers" ADD CONSTRAINT "counter_offers_bid_log_id_fkey" FOREIGN KEY ("bid_log_id") REFERENCES "bid_logs"("id") ON DELETE SET NULL ON UPDATE CASCADE;
13
+
14
+ -- AddForeignKey
15
+ ALTER TABLE "counter_offers" ADD CONSTRAINT "counter_offers_quotation_log_id_fkey" FOREIGN KEY ("quotation_log_id") REFERENCES "quotation_logs"("id") ON DELETE SET NULL ON UPDATE CASCADE;
@@ -0,0 +1,10 @@
1
+ -- AlterEnum
2
+ -- This migration adds more than one value to an enum.
3
+ -- With PostgreSQL versions 11 and earlier, this is not possible
4
+ -- in a single migration. This can be worked around by creating
5
+ -- multiple migrations, each migration adding only one value to
6
+ -- the enum.
7
+
8
+
9
+ ALTER TYPE "BidStatus" ADD VALUE 'REJECTED';
10
+ ALTER TYPE "BidStatus" ADD VALUE 'ACCEPTED';
@@ -0,0 +1,16 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to drop the column `location` on the `purchase_intakes_items` table. All the data in the column will be lost.
5
+
6
+ */
7
+ -- AlterTable
8
+ ALTER TABLE "purchase_intakes_items" DROP COLUMN "location",
9
+ ADD COLUMN "location_id" INTEGER,
10
+ ALTER COLUMN "purchase_intakes_id" DROP NOT NULL,
11
+ ALTER COLUMN "item_id" DROP NOT NULL,
12
+ ALTER COLUMN "quantity" DROP NOT NULL,
13
+ ALTER COLUMN "unit_of_measurement" DROP NOT NULL;
14
+
15
+ -- AddForeignKey
16
+ ALTER TABLE "purchase_intakes_items" ADD CONSTRAINT "purchase_intakes_items_location_id_fkey" FOREIGN KEY ("location_id") REFERENCES "locations"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,13 @@
1
+ -- AlterEnum
2
+ -- This migration adds more than one value to an enum.
3
+ -- With PostgreSQL versions 11 and earlier, this is not possible
4
+ -- in a single migration. This can be worked around by creating
5
+ -- multiple migrations, each migration adding only one value to
6
+ -- the enum.
7
+
8
+
9
+ ALTER TYPE "PurchaseIntakeItemEnum" ADD VALUE 'OnHold';
10
+ ALTER TYPE "PurchaseIntakeItemEnum" ADD VALUE 'Partial';
11
+ ALTER TYPE "PurchaseIntakeItemEnum" ADD VALUE 'Closed';
12
+ ALTER TYPE "PurchaseIntakeItemEnum" ADD VALUE 'Cancelled';
13
+ ALTER TYPE "PurchaseIntakeItemEnum" ADD VALUE 'Rejected';
@@ -0,0 +1,12 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to drop the column `currency` on the `templates` table. All the data in the column will be lost.
5
+
6
+ */
7
+ -- AlterTable
8
+ ALTER TABLE "templates" DROP COLUMN "currency",
9
+ ADD COLUMN "currency_id" INTEGER;
10
+
11
+ -- AddForeignKey
12
+ ALTER TABLE "templates" ADD CONSTRAINT "templates_currency_id_fkey" FOREIGN KEY ("currency_id") REFERENCES "currencies"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,3 @@
1
+ -- AlterTable
2
+ ALTER TABLE "approval_journey" ADD COLUMN "duration" TEXT,
3
+ ADD COLUMN "valid_to" TIMESTAMP(3);
@@ -0,0 +1,2 @@
1
+ -- AlterTable
2
+ ALTER TABLE "item" ADD COLUMN "specifications" JSONB;
@@ -0,0 +1,2 @@
1
+ -- AddForeignKey
2
+ ALTER TABLE "events" ADD CONSTRAINT "events_template_id_fkey" FOREIGN KEY ("template_id") REFERENCES "templates"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,2 @@
1
+ -- AlterTable
2
+ ALTER TABLE "vendors" ADD COLUMN "is_kyc_approved" "VendorKycVerificationStatusEnum" NOT NULL DEFAULT 'PENDING';
@@ -0,0 +1,52 @@
1
+ -- CreateEnum
2
+ CREATE TYPE "PurchaseOrderStatus" AS ENUM ('PENDING', 'APPROVED', 'REJECTED', 'COMPLETED');
3
+
4
+ -- CreateTable
5
+ CREATE TABLE "purchase_orders" (
6
+ "id" SERIAL NOT NULL,
7
+ "uuid" TEXT NOT NULL,
8
+ "event_id" INTEGER,
9
+ "event_vendor_id" INTEGER,
10
+ "purchase_request_id" INTEGER,
11
+ "purchase_order_no" TEXT,
12
+ "purchase_order_date" TIMESTAMP(3),
13
+ "total_amount" DECIMAL(10,2) DEFAULT 0.00,
14
+ "status" "PurchaseOrderStatus" DEFAULT 'PENDING',
15
+ "attachments" JSONB,
16
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
17
+ "created_by" INTEGER,
18
+ "updated_at" TIMESTAMP(3) NOT NULL,
19
+ "updated_by" INTEGER,
20
+ "is_deleted" BOOLEAN NOT NULL DEFAULT false,
21
+ "deleted_at" TIMESTAMP(3),
22
+ "deleted_by" INTEGER,
23
+
24
+ CONSTRAINT "purchase_orders_pkey" PRIMARY KEY ("id")
25
+ );
26
+
27
+ -- CreateIndex
28
+ CREATE UNIQUE INDEX "purchase_orders_uuid_key" ON "purchase_orders"("uuid");
29
+
30
+ -- CreateIndex
31
+ CREATE UNIQUE INDEX "purchase_orders_purchase_order_no_key" ON "purchase_orders"("purchase_order_no");
32
+
33
+ -- CreateIndex
34
+ CREATE INDEX "purchase_orders_event_id_idx" ON "purchase_orders"("event_id");
35
+
36
+ -- CreateIndex
37
+ CREATE INDEX "purchase_orders_event_vendor_id_idx" ON "purchase_orders"("event_vendor_id");
38
+
39
+ -- CreateIndex
40
+ CREATE INDEX "purchase_orders_purchase_request_id_idx" ON "purchase_orders"("purchase_request_id");
41
+
42
+ -- CreateIndex
43
+ CREATE INDEX "purchase_orders_status_idx" ON "purchase_orders"("status");
44
+
45
+ -- AddForeignKey
46
+ ALTER TABLE "purchase_orders" ADD CONSTRAINT "purchase_orders_event_id_fkey" FOREIGN KEY ("event_id") REFERENCES "events"("id") ON DELETE CASCADE ON UPDATE CASCADE;
47
+
48
+ -- AddForeignKey
49
+ ALTER TABLE "purchase_orders" ADD CONSTRAINT "purchase_orders_event_vendor_id_fkey" FOREIGN KEY ("event_vendor_id") REFERENCES "event_vendors"("id") ON DELETE CASCADE ON UPDATE CASCADE;
50
+
51
+ -- AddForeignKey
52
+ ALTER TABLE "purchase_orders" ADD CONSTRAINT "purchase_orders_purchase_request_id_fkey" FOREIGN KEY ("purchase_request_id") REFERENCES "purchase_intakes"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,16 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - The values [APPROVED] on the enum `PurchaseOrderStatus` will be removed. If these variants are still used in the database, this will fail.
5
+
6
+ */
7
+ -- AlterEnum
8
+ BEGIN;
9
+ CREATE TYPE "PurchaseOrderStatus_new" AS ENUM ('PENDING', 'REQUESTED', 'REJECTED', 'COMPLETED');
10
+ ALTER TABLE "purchase_orders" ALTER COLUMN "status" DROP DEFAULT;
11
+ ALTER TABLE "purchase_orders" ALTER COLUMN "status" TYPE "PurchaseOrderStatus_new" USING ("status"::text::"PurchaseOrderStatus_new");
12
+ ALTER TYPE "PurchaseOrderStatus" RENAME TO "PurchaseOrderStatus_old";
13
+ ALTER TYPE "PurchaseOrderStatus_new" RENAME TO "PurchaseOrderStatus";
14
+ DROP TYPE "PurchaseOrderStatus_old";
15
+ ALTER TABLE "purchase_orders" ALTER COLUMN "status" SET DEFAULT 'PENDING';
16
+ COMMIT;