Skip to content

Commit

Permalink
feat: add cocNumber to client
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanvanherwijnen committed Dec 6, 2024
1 parent 723f287 commit 04f7f11
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 31 deletions.
4 changes: 2 additions & 2 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
"@fastify/cors": "^10.0.1",
"@fastify/middie": "9.0.2",
"@fastify/static": "8.0.3",
"@modular-api/api": "^0.5.15",
"@modular-api/api": "^0.5.16",
"@modular-api/fastify-cart": "^0.3.2",
"@modular-api/fastify-checkout": "^0.4.10",
"@modular-api/fastify-checkout": "^0.4.11",
"@modular-api/fastify-oidc": "^0.6.4",
"@mollie/api-client": "^4.1.0",
"@slimfact/app": "^0.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export async function up(db: Kysely<unknown>): Promise<void> {
.addColumn('city', 'varchar', (col) => col.notNull())
.addColumn('country', 'varchar')
.addColumn('vat_id_number', 'varchar')
.addColumn('coc_number', 'varchar')
.addColumn('email', 'varchar', (col) => col.notNull().unique())

.addColumn('account_id', 'integer', (col) => col.references('accounts.id'))
Expand Down
1 change: 1 addition & 0 deletions packages/api/src/kysely/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export interface Clients {
contactPersonName: string | null
country: string
vatIdNumber: string | null
cocNumber: string | null
createdAt: Generated<string>
email: string
id: Generated<number>
Expand Down
1 change: 1 addition & 0 deletions packages/api/src/repositories/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const defaultSelect = [
'contactPersonName',
'country',
'vatIdNumber',
'cocNumber',
'email',
'postalCode',
'accountId'
Expand Down
1 change: 1 addition & 0 deletions packages/api/src/zod/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const clientValidation = {
contactPersonName: z.string().optional(),
country: z.string().optional(),
vatIdNumber: z.string().nullable().optional(),
cocNumber: z.string().nullable().optional(),
email: z.string().email(),
postalCode: z.string(),
accountId: z.number().nullable().optional()
Expand Down
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
},
"devDependencies": {
"@modular-api/fastify-cart": "^0.3.2",
"@modular-api/fastify-checkout": "^0.4.10",
"@modular-api/fastify-checkout": "^0.4.11",
"@modular-api/quasar-components": "^0.3.6",
"@quasar/extras": "1.16.13",
"@quasar/quasar-ui-qcalendar": "4.0.0-beta.16",
Expand Down
9 changes: 9 additions & 0 deletions packages/app/src/components/client/ClientForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@
lazy-rules
name="vatIdNumber"
/>
<form-input
v-bind="input"
v-model="modelValue.cocNumber"
:label="lang.client.fields.cocNumber"
class="col-md-3 col-12"
bottom-slots
lazy-rules
name="cocNumber"
/>
<form-input
v-bind="input"
v-model="modelValue.email"
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/lang/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ const lang: Language = {
city: 'City',
country: 'Country',
vatIdNumber: 'VAT ID number',
cocNumber: 'CoC number',
email: 'Email'
},
validations: {
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/lang/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export interface Language {
city: string
country: string
vatIdNumber: string
cocNumber: string
email: string
}
validations: {
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/lang/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ const lang: Language = {
city: 'Woonplaats',
country: 'Land',
vatIdNumber: 'BTW ID nummer',
cocNumber: 'KvK nummer',
email: 'Email'
},
validations: {
Expand Down
59 changes: 31 additions & 28 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 04f7f11

Please sign in to comment.