alexandercerutti / passkit-generator

The easiest way to generate custom Apple Wallet passes in Node.js
MIT License
891 stars 109 forks source link

Facing difficulties while designing the passs #213

Closed prashant03Dev closed 3 months ago

prashant03Dev commented 3 months ago

@alexandercerutti

Currently i'm struggling while updating the pass,As we are showing some details on auxillary field,and we want to add some more fields values to that,but they are getting mixtured.

Below we are sharing the design of the template

const passCreated: Awaited<PassKit.PKPass> = await this.walletService.createPass(
                'Event.pass',
                this.user.uuid,
                `${generateUuidV4()}/vehicle-id-card-pass`,
            );

            // make passCreated
            passCreated.type = PassType.EVENT_TICKET;

            passCreated.headerFields.push({
                key: 'issuedBy',
                label: 'Issued By',
                value: `Organization name`,
            });

            passCreated.primaryFields.push(
                {
                    key: 'name',
                    label: 'Insured name',
                    value: `value`,
                },
                {
                    key: 'description',
                    label: 'Description',
                    value: `${this.payload.description}`,
                },
            );

            passCreated.secondaryFields.push(
                {
                    key: 'startDate',
                    label: 'Effective Date',
                    value: `${formatDate(this.payload.effectiveDate, DateTimeFormatEnum.MM_DD_YYYY)}`,
                },
                {
                    key: 'expirationDate',
                    label: 'Policy Expiration',
                    value: `${formatDate(this.payload.expirationDate, DateTimeFormatEnum.MM_DD_YYYY)}`,
                },
            );

            passCreated.auxiliaryFields.push(
                {
                    key: 'policyNo',
                    label: 'Policy Number',
                    value: `${this.payload.policyNo}`,
                },
                {
                    key: 'vin',
                    label: 'VIN',
                    value: `${this.payload.vin}`,
                    textAlignment: 'PKTextAlignmentRight',
                },
            );

            passCreated.auxiliaryFields.push(
                {
                    key: 'make',
                    label: 'Make',
                    value: `${this.payload.make}`,
                },
                {
                    key: 'model',
                    label: 'Model',
                    value: `${this.payload.model}`,
                    textAlignment: 'PKTextAlignmentRight',
                },
            );

            const buffer = passCreated.getAsBuffer();

            await fs.writeFile('vechile-card.pkpass', buffer);

            // await this.upsertPass();

            response.setHeader('Content-Type', 'application/vnd.apple.pkpass');
            response.setHeader('Content-Disposition', `attachment; filename="vehicle-pass.pkpass"`);

            response.send(buffer);
}

As when adding make and model field,they both got attached to policynumber field,

Suggest us the way to get the design of the pass to be update,as well as share some pass design to follow the principle

Thanks & Regards, Prashant

alexandercerutti commented 3 months ago

Hi @prashant03Dev,

What do you mean by "mixtured"? What is the result you would expect?

P.s. no need to tag me, as I receive all the issues.

prashant03Dev commented 3 months ago

@alexandercerutti

Mixtured means we are having glitch in design part,As I'm sharing a snapshot with you,

As you can see,we are trying to shift Make and model key to down line.

pass
prashant03Dev commented 3 months ago

@alexandercerutti

Mixtured means we are having glitch in design part,As I'm sharing a snapshot with you,

As you can see,we are trying to shift Make and model key to down line.

pass

Can we get quick update on this,how can we adjust

prashant03Dev commented 3 months ago

@alexandercerutti are you there,As this issue are need to deploy ASAP,So can you take a time of yours to help us in this pass design.

alexandercerutti commented 3 months ago

No. I've other things to do in my life.

When you'll decide to contribute financially to the project on OpenCollective, I'll be happy to support you with the higher priority I can give you. Otherwise, you'll have to wait as I get free.

prashant03Dev commented 3 months ago

Thanks @alexandercerutti,I'm closing this issue.

alexandercerutti commented 3 months ago

I guess you solved. Nice if so. 🚀